Trait faiss::gpu::GpuResources

source ·
pub trait GpuResources {
    fn inner_ptr(&self) -> *mut FaissGpuResources;
    fn no_temp_memory(&mut self) -> Result<()>;
    fn set_temp_memory(&mut self, size: usize) -> Result<()>;
    fn set_temp_memory_fraction(&mut self, fraction: f32) -> Result<()>;
    fn set_pinned_memory(&mut self, size: usize) -> Result<()>;
}
Expand description

Common interface for GPU resources used by Faiss.

Required Methods§

Obtain a raw pointer to the native GPU resources object.

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

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

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

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

Implementors§