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

#include <StandardGpuResources.h>

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

Public Member Functions

void noTempMemory ()
 
void setTempMemory (size_t size)
 
void setTempMemoryFraction (float fraction)
 
void setPinnedMemory (size_t size)
 
void setDefaultStream (int device, cudaStream_t stream)
 Called to change the stream for work ordering.
 
void setDefaultNullStreamAllDevices ()
 
void setCudaMallocWarning (bool b)
 
void initializeForDevice (int device) override
 Internal system calls.
 
cublasHandle_t getBlasHandle (int device) override
 Returns the cuBLAS handle that we use for the given device.
 
cudaStream_t getDefaultStream (int device) override
 
std::vector< cudaStream_t > getAlternateStreams (int device) override
 Returns the set of alternative streams that we use for the given device.
 
DeviceMemory & getMemoryManager (int device) override
 Returns the temporary memory manager for the given device.
 
std::pair< void *, size_t > getPinnedMemory () override
 Returns the available CPU pinned memory buffer.
 
cudaStream_t getAsyncCopyStream (int device) override
 Returns the stream on which we perform async CPU <-> GPU copies.
 
- Public Member Functions inherited from faiss::gpu::GpuResources
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.
 
DeviceMemory & getMemoryManagerCurrentDevice ()
 Calls getMemoryManager for the current device.
 
cudaStream_t getAsyncCopyStreamCurrentDevice ()
 Calls getAsyncCopyStream for the current device.
 

Detailed Description

Default implementation of GpuResources that allocates a cuBLAS stream and 2 streams for use, as well as temporary memory

Definition at line 22 of file StandardGpuResources.h.

Member Function Documentation

cudaStream_t faiss::gpu::StandardGpuResources::getDefaultStream ( int  device)
overridevirtual

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

Implements faiss::gpu::GpuResources.

Definition at line 224 of file StandardGpuResources.cpp.

void faiss::gpu::StandardGpuResources::noTempMemory ( )

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

Definition at line 76 of file StandardGpuResources.cpp.

void faiss::gpu::StandardGpuResources::setCudaMallocWarning ( bool  b)

Enable or disable the warning about not having enough temporary memory when cudaMalloc gets called

Definition at line 123 of file StandardGpuResources.cpp.

void faiss::gpu::StandardGpuResources::setDefaultNullStreamAllDevices ( )

Called to change the work ordering streams to the null stream for all devices

Definition at line 116 of file StandardGpuResources.cpp.

void faiss::gpu::StandardGpuResources::setPinnedMemory ( size_t  size)

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

Definition at line 95 of file StandardGpuResources.cpp.

void faiss::gpu::StandardGpuResources::setTempMemory ( size_t  size)

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

Definition at line 82 of file StandardGpuResources.cpp.

void faiss::gpu::StandardGpuResources::setTempMemoryFraction ( float  fraction)

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

Definition at line 88 of file StandardGpuResources.cpp.


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