13 #include <cuda_runtime.h>
16 namespace faiss {
namespace gpu {
24 int device,
void* p,
size_t size,
31 int device() {
return device_; }
32 void*
get() {
return data_; }
33 size_t size() {
return size_; }
34 cudaStream_t stream() {
return stream_; }
62 virtual std::string
toString()
const = 0;
virtual size_t getHighWaterCudaMalloc() const =0
virtual std::string toString() const =0
Returns a string containing our current memory manager state.
virtual size_t getSizeAvailable() const =0
Returns the current size available without calling cudaMalloc.
virtual DeviceMemoryReservation getMemory(cudaStream_t stream, size_t size)=0
virtual int getDevice() const =0
Returns the device we are managing memory for.
Manages temporary memory allocations on a GPU device.