#include <StackDeviceMemory.h>
Classes | |
struct | Range |
struct | Stack |
Public Member Functions | |
StackDeviceMemory (int device, size_t allocPerDevice) | |
Allocate a new region of memory that we manage. | |
StackDeviceMemory (int device, void *p, size_t size, bool isOwner) | |
int | getDevice () const override |
Returns the device we are managing memory for. | |
DeviceMemoryReservation | getMemory (cudaStream_t stream, size_t size) override |
size_t | getSizeAvailable () const override |
Returns the current size available without calling cudaMalloc. | |
std::string | toString () const override |
Returns a string containing our current memory manager state. | |
size_t | getHighWaterCudaMalloc () const override |
Protected Member Functions | |
void | returnAllocation (DeviceMemoryReservation &m) override |
Protected Attributes | |
int | device_ |
Our device. | |
Stack | stack_ |
Memory stack. | |
Device memory manager that provides temporary memory allocations out of a region of memory
Definition at line 22 of file StackDeviceMemory.h.
faiss::gpu::StackDeviceMemory::StackDeviceMemory | ( | int | device, |
void * | p, | ||
size_t | size, | ||
bool | isOwner | ||
) |
Manage a region of memory for a particular device, with or without ownership
Definition at line 185 of file StackDeviceMemory.cpp.
|
overridevirtual |
Returns the high-water mark of cudaMalloc allocations for our device
Implements faiss::gpu::DeviceMemory.
Definition at line 223 of file StackDeviceMemory.cpp.
|
overridevirtual |
Obtains a temporary memory allocation for our device, whose usage is ordered with respect to the given stream.
Implements faiss::gpu::DeviceMemory.
Definition at line 200 of file StackDeviceMemory.cpp.