14 #include <cuda_runtime.h>
17 namespace faiss {
namespace gpu {
25 int device,
void* p,
size_t size,
32 int device() {
return device_; }
33 void*
get() {
return data_; }
34 size_t size() {
return size_; }
35 cudaStream_t stream() {
return stream_; }
63 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.