OmniSciDB
a5dc49c757
|
#include <DeviceMemoryAllocationMap.h>
Classes | |
struct | Allocation |
Public Types | |
using | DevicePtr = uint64_t |
using | Map = std::map< DevicePtr, Allocation > |
using | MapChangedCBID = uint32_t |
using | MapChangedCB = std::function< void(const heavyai::UUID, const bool)> |
Public Member Functions | |
DeviceMemoryAllocationMap () | |
~DeviceMemoryAllocationMap ()=default | |
const Map & | getMap () const |
const bool | mapEmpty () const |
void | addAllocation (const DevicePtr device_ptr, const uint64_t size, const uint64_t handle, const heavyai::UUID uuid, const int device_num, const bool is_slab) |
Allocation | removeAllocation (const DevicePtr device_ptr) |
std::pair< DevicePtr, Allocation > | getAllocation (const DevicePtr device_ptr) |
const MapChangedCBID | registerMapChangedCB (MapChangedCB cb) |
void | unregisterMapChangedCB (const MapChangedCBID cbid) |
void | notifyMapChanged (const heavyai::UUID device_uuid, const bool is_slab) const |
Private Attributes | |
Map | map_ |
MapChangedCBID | last_map_changed_cbid_ |
std::unordered_map < MapChangedCBID, MapChangedCB > | map_changed_cbs_ |
Definition at line 28 of file DeviceMemoryAllocationMap.h.
using CudaMgr_Namespace::DeviceMemoryAllocationMap::DevicePtr = uint64_t |
Definition at line 30 of file DeviceMemoryAllocationMap.h.
using CudaMgr_Namespace::DeviceMemoryAllocationMap::Map = std::map<DevicePtr, Allocation> |
Definition at line 38 of file DeviceMemoryAllocationMap.h.
using CudaMgr_Namespace::DeviceMemoryAllocationMap::MapChangedCB = std::function<void(const heavyai::UUID, const bool)> |
Definition at line 40 of file DeviceMemoryAllocationMap.h.
using CudaMgr_Namespace::DeviceMemoryAllocationMap::MapChangedCBID = uint32_t |
Definition at line 39 of file DeviceMemoryAllocationMap.h.
CudaMgr_Namespace::DeviceMemoryAllocationMap::DeviceMemoryAllocationMap | ( | ) |
Definition at line 24 of file DeviceMemoryAllocationMap.cpp.
|
default |
void CudaMgr_Namespace::DeviceMemoryAllocationMap::addAllocation | ( | const DevicePtr | device_ptr, |
const uint64_t | size, | ||
const uint64_t | handle, | ||
const heavyai::UUID | uuid, | ||
const int | device_num, | ||
const bool | is_slab | ||
) |
Definition at line 34 of file DeviceMemoryAllocationMap.cpp.
std::pair< DeviceMemoryAllocationMap::DevicePtr, DeviceMemoryAllocationMap::Allocation > CudaMgr_Namespace::DeviceMemoryAllocationMap::getAllocation | ( | const DevicePtr | device_ptr | ) |
Definition at line 58 of file DeviceMemoryAllocationMap.cpp.
const DeviceMemoryAllocationMap::Map & CudaMgr_Namespace::DeviceMemoryAllocationMap::getMap | ( | ) | const |
Definition at line 26 of file DeviceMemoryAllocationMap.cpp.
References map_.
const bool CudaMgr_Namespace::DeviceMemoryAllocationMap::mapEmpty | ( | ) | const |
Definition at line 30 of file DeviceMemoryAllocationMap.cpp.
References map_.
void CudaMgr_Namespace::DeviceMemoryAllocationMap::notifyMapChanged | ( | const heavyai::UUID | device_uuid, |
const bool | is_slab | ||
) | const |
Definition at line 80 of file DeviceMemoryAllocationMap.cpp.
References map_changed_cbs_.
const DeviceMemoryAllocationMap::MapChangedCBID CudaMgr_Namespace::DeviceMemoryAllocationMap::registerMapChangedCB | ( | MapChangedCB | cb | ) |
Definition at line 68 of file DeviceMemoryAllocationMap.cpp.
References CHECK, last_map_changed_cbid_, and map_changed_cbs_.
DeviceMemoryAllocationMap::Allocation CudaMgr_Namespace::DeviceMemoryAllocationMap::removeAllocation | ( | const DevicePtr | device_ptr | ) |
Definition at line 44 of file DeviceMemoryAllocationMap.cpp.
void CudaMgr_Namespace::DeviceMemoryAllocationMap::unregisterMapChangedCB | ( | const MapChangedCBID | cbid | ) |
Definition at line 74 of file DeviceMemoryAllocationMap.cpp.
References CHECK, and map_changed_cbs_.
|
private |
Definition at line 63 of file DeviceMemoryAllocationMap.h.
Referenced by registerMapChangedCB().
|
private |
Definition at line 62 of file DeviceMemoryAllocationMap.h.
Referenced by addAllocation(), getAllocation(), getMap(), mapEmpty(), and removeAllocation().
|
private |
Definition at line 64 of file DeviceMemoryAllocationMap.h.
Referenced by notifyMapChanged(), registerMapChangedCB(), and unregisterMapChangedCB().