Trait faiss::gpu::GpuResources [−][src]
pub trait GpuResources { 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
fn inner_ptr(&self) -> *mut FaissGpuResourcesProvider
fn inner_ptr(&self) -> *mut FaissGpuResourcesProvider
Obtain a raw pointer to the native GPU resources object.
fn no_temp_memory(&mut self) -> Result<()>
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
fn set_temp_memory(&mut self, size: usize) -> Result<()>
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
fn set_pinned_memory(&mut self, size: usize) -> Result<()>
fn set_pinned_memory(&mut self, size: usize) -> Result<()>
Set amount of pinned memory to allocate, for async GPU <-> CPU transfers