Trait faiss::gpu::GpuResources

source ·
pub trait GpuResources {
    // Required methods
    fn inner_ptr(&self) -> *mut FaissGpuResourcesProvider;
    fn no_temp_memory(&mut self) -> Result<()>;
    fn set_temp_memory(&mut self, size: usize) -> Result<()>;
    fn set_pinned_memory(&mut self, size: usize) -> Result<()>;
}
Expand description

Common interface for GPU resources used by Faiss.

Required Methods§

source

fn inner_ptr(&self) -> *mut FaissGpuResourcesProvider

Obtain a raw pointer to the native GPU resources object.

source

fn no_temp_memory(&mut self) -> Result<()>

Disable allocation of temporary memory; all temporary memory requests will call cudaMalloc / cudaFree at the point of use

source

fn set_temp_memory(&mut self, size: usize) -> Result<()>

Specify that we wish to use a certain fixed size of memory on all devices as temporary memory

source

fn set_pinned_memory(&mut self, size: usize) -> Result<()>

Set amount of pinned memory to allocate, for async GPU <-> CPU transfers

Implementors§