22 #include <unordered_map>
26 namespace CudaMgr_Namespace {
38 using Map = std::map<DevicePtr, Allocation>;
40 using MapChangedCB = std::function<void(const heavyai::UUID, const bool)>;
50 const uint64_t handle,
std::unordered_map< MapChangedCBID, MapChangedCB > map_changed_cbs_
const Map & getMap() const
void notifyMapChanged(const heavyai::UUID device_uuid, const bool is_slab) const
Allocation removeAllocation(const DevicePtr device_ptr)
No-frills UUID type class to allow easy containerization and comparison of device UUIDs from differen...
const MapChangedCBID registerMapChangedCB(MapChangedCB cb)
std::function< void(const heavyai::UUID, const bool)> MapChangedCB
std::map< DevicePtr, Allocation > Map
MapChangedCBID last_map_changed_cbid_
heavyai::UUID device_uuid
DeviceMemoryAllocationMap()
void unregisterMapChangedCB(const MapChangedCBID cbid)
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)
std::pair< DevicePtr, Allocation > getAllocation(const DevicePtr device_ptr)
~DeviceMemoryAllocationMap()=default
const bool mapEmpty() const
std::unique_ptr< DeviceMemoryAllocationMap > DeviceMemoryAllocationMapUqPtr