#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) | |
| void | setCudaMallocWarning (bool b) |
| 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 21 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 192 of file StackDeviceMemory.cpp.
|
overridevirtual |
Returns the high-water mark of cudaMalloc allocations for our device
Implements faiss::gpu::DeviceMemory.
Definition at line 235 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 212 of file StackDeviceMemory.cpp.
| void faiss::gpu::StackDeviceMemory::setCudaMallocWarning | ( | bool | b | ) |
Enable or disable the warning about not having enough temporary memory when cudaMalloc gets called
Definition at line 202 of file StackDeviceMemory.cpp.
1.8.5