Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | List of all members
faiss::gpu::GpuResources Class Referenceabstract

#include <GpuResources.h>

Inheritance diagram for faiss::gpu::GpuResources:
faiss::gpu::StandardGpuResources

Public Member Functions

virtual void initializeForDevice (int device)=0
 
virtual cublasHandle_t getBlasHandle (int device)=0
 Returns the cuBLAS handle that we use for the given device.
 
virtual cudaStream_t getDefaultStream (int device)=0
 
virtual std::vector< cudaStream_t > getAlternateStreams (int device)=0
 Returns the set of alternative streams that we use for the given device.
 
virtual DeviceMemorygetMemoryManager (int device)=0
 Returns the temporary memory manager for the given device.
 
virtual std::pair< void *, size_t > getPinnedMemory ()=0
 Returns the available CPU pinned memory buffer.
 
virtual cudaStream_t getAsyncCopyStream (int device)=0
 Returns the stream on which we perform async CPU <-> GPU copies.
 
cublasHandle_t getBlasHandleCurrentDevice ()
 Calls getBlasHandle with the current device.
 
cudaStream_t getDefaultStreamCurrentDevice ()
 Calls getDefaultStream with the current device.
 
void syncDefaultStream (int device)
 
void syncDefaultStreamCurrentDevice ()
 Calls syncDefaultStream for the current device.
 
std::vector< cudaStream_t > getAlternateStreamsCurrentDevice ()
 Calls getAlternateStreams for the current device.
 
DeviceMemorygetMemoryManagerCurrentDevice ()
 Calls getMemoryManager for the current device.
 
cudaStream_t getAsyncCopyStreamCurrentDevice ()
 Calls getAsyncCopyStream for the current device.
 

Detailed Description

Base class of GPU-side resource provider; hides provision of cuBLAS handles, CUDA streams and a temporary memory manager

Definition at line 23 of file GpuResources.h.

Member Function Documentation

virtual cudaStream_t faiss::gpu::GpuResources::getDefaultStream ( int  device)
pure virtual

Returns the stream that we order all computation on for the given device

Implemented in faiss::gpu::StandardGpuResources.

virtual void faiss::gpu::GpuResources::initializeForDevice ( int  device)
pure virtual

Call to pre-allocate resources for a particular device. If this is not called, then resources will be allocated at the first time of demand

Implemented in faiss::gpu::StandardGpuResources.

void faiss::gpu::GpuResources::syncDefaultStream ( int  device)

Synchronizes the CPU with respect to the default stream for the given device

Definition at line 45 of file GpuResources.cpp.


The documentation for this class was generated from the following files: