Faiss

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
faiss::gpu::StackDeviceMemory Class Reference

`#include <StackDeviceMemory.h>`

Inheritance diagram for faiss::gpu::StackDeviceMemory:

## 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.

## Detailed Description

Device memory manager that provides temporary memory allocations out of a region of memory

Definition at line 23 of file StackDeviceMemory.h.

## Constructor & Destructor Documentation

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 181 of file StackDeviceMemory.cpp.

## Member Function Documentation

size_t faiss::gpu::StackDeviceMemory::getHighWaterCudaMalloc | ( |  | ) | const
| override virtual

Returns the high-water mark of cudaMalloc allocations for our device

Implements faiss::gpu::DeviceMemory.

Definition at line 219 of file StackDeviceMemory.cpp.

DeviceMemoryReservation faiss::gpu::StackDeviceMemory::getMemory | ( | cudaStream_t | stream,
|  | size_t | size
| ) |  |
| override virtual

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 196 of file StackDeviceMemory.cpp.

The documentation for this class was generated from the following files:

- /data/users/matthijs/github_faiss/faiss/gpu/utils/StackDeviceMemory.h
- /data/users/matthijs/github_faiss/faiss/gpu/utils/StackDeviceMemory.cpp