13 #include "utils/DeviceMemory.h"
14 #include <cuda_runtime.h>
15 #include <cublas_v2.h>
19 namespace faiss {
namespace gpu {
virtual void initializeForDevice(int device)=0
cudaStream_t getDefaultStreamCurrentDevice()
Calls getDefaultStream with the current device.
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
cublasHandle_t getBlasHandleCurrentDevice()
Calls getBlasHandle with the current device.
DeviceMemory & getMemoryManagerCurrentDevice()
Calls getMemoryManager for the current device.
void syncDefaultStreamCurrentDevice()
Calls syncDefaultStream for the current device.
cudaStream_t getAsyncCopyStreamCurrentDevice()
Calls getAsyncCopyStream for the current device.
std::vector< cudaStream_t > getAlternateStreamsCurrentDevice()
Calls getAlternateStreams for the current device.
virtual cudaStream_t getAsyncCopyStream(int device)=0
Returns the stream on which we perform async CPU <-> GPU copies.
void syncDefaultStream(int device)
virtual DeviceMemory & getMemoryManager(int device)=0
Returns the temporary memory manager for the given device.
Manages temporary memory allocations on a GPU device.
virtual std::pair< void *, size_t > getPinnedMemory()=0
Returns the available CPU pinned memory buffer.
virtual std::vector< cudaStream_t > getAlternateStreams(int device)=0
Returns the set of alternative streams that we use for the given device.