12 #include <cuda_runtime.h>
15 namespace faiss {
namespace gpu {
23 int device,
void* p,
size_t size,
30 int device() {
return device_; }
31 void*
get() {
return data_; }
32 size_t size() {
return size_; }
33 cudaStream_t stream() {
return stream_; }
61 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.