DeviceMemory#

#include <DeviceMemory.h>

How to cite this class in this doc#

:ref:`DeviceMemory <class-devicememory>`
[DeviceMemory](#class-devicememory)

Detailed description#

List of Public Methods#

List of Public Static Methods#

Complete Member Function Documentation#

DeviceMemory
DeviceMemory::DeviceMemory()=delete
How to cite in this doc:
:ref:`DeviceMemory::DeviceMemory()=delete <public-devicememory-devicememory-equal-delete>`
[DeviceMemory::DeviceMemory()=delete](#public-devicememory-devicememory-equal-delete)
add
void DeviceMemory::add(void *ptr, void *device_ptr, trustIdType bytes)

Add a new line to the memory_map_ ptr should be non - null, device_ptr and size may be null

References
How to cite in this doc:
:ref:`void DeviceMemory::add(void *ptr, void *device_ptr, trustIdType bytes) <public-static-void-devicememory-add-void-ptr-ptr-void-ptr-device-ptr-trustidtype-bytes>`
[void DeviceMemory::add(void *ptr, void *device_ptr, trustIdType bytes)](#public-static-void-devicememory-add-void-ptr-ptr-void-ptr-device-ptr-trustidtype-bytes)
addrOnDevice
void * DeviceMemory::addrOnDevice(void *)

Return the device address of the host ptr Return nullptr if ptr null or map empty Fatal error if address not found on the device

References
How to cite in this doc:
:ref:`void * DeviceMemory::addrOnDevice(void *) <public-static-void-ptr-devicememory-addrondevice-void-ptr>`
[void * DeviceMemory::addrOnDevice(void *)](#public-static-void-ptr-devicememory-addrondevice-void-ptr)
allocatedBytesOnDevice
size_t DeviceMemory::allocatedBytesOnDevice()
References
Referenced By
How to cite in this doc:
:ref:`size_t DeviceMemory::allocatedBytesOnDevice() <public-static-size-t-devicememory-allocatedbytesondevice>`
[size_t DeviceMemory::allocatedBytesOnDevice()](#public-static-size-t-devicememory-allocatedbytesondevice)
del
void DeviceMemory::del(void *ptr)

Delete a line into the memory_map_

References
How to cite in this doc:
:ref:`void DeviceMemory::del(void *ptr) <public-static-void-devicememory-del-void-ptr-ptr>`
[void DeviceMemory::del(void *ptr)](#public-static-void-devicememory-del-void-ptr-ptr)
deviceMemGetInfo
size_t DeviceMemory::deviceMemGetInfo(bool)
References
Referenced By
How to cite in this doc:
:ref:`size_t DeviceMemory::deviceMemGetInfo(bool) <public-static-size-t-devicememory-devicememgetinfo-bool>`
[size_t DeviceMemory::deviceMemGetInfo(bool)](#public-static-size-t-devicememory-devicememgetinfo-bool)
getMemoryMap
static map_t & DeviceMemory::getMemoryMap()
Referenced By
How to cite in this doc:
:ref:`static map_t & DeviceMemory::getMemoryMap() <public-static-static-map-t-ref-devicememory-getmemorymap>`
[static map_t & DeviceMemory::getMemoryMap()](#public-static-static-map-t-ref-devicememory-getmemorymap)
isAllocatedOnDevice
bool DeviceMemory::isAllocatedOnDevice(void *)

Check if a chunk (even empty) is allocated on the device for the host ptr Return true/false

How to cite in this doc:
:ref:`bool DeviceMemory::isAllocatedOnDevice(void *) <public-static-bool-devicememory-isallocatedondevice-void-ptr>`
[bool DeviceMemory::isAllocatedOnDevice(void *)](#public-static-bool-devicememory-isallocatedondevice-void-ptr)
printMemoryMap
void DeviceMemory::printMemoryMap()

Print the memory map for debug

References
Referenced By
How to cite in this doc:
:ref:`void DeviceMemory::printMemoryMap() <public-static-void-devicememory-printmemorymap>`
[void DeviceMemory::printMemoryMap()](#public-static-void-devicememory-printmemorymap)
warning
bool DeviceMemory::warning(trustIdType nb_items)
References
How to cite in this doc:
:ref:`bool DeviceMemory::warning(trustIdType nb_items) <public-static-bool-devicememory-warning-trustidtype-nb-items>`
[bool DeviceMemory::warning(trustIdType nb_items)](#public-static-bool-devicememory-warning-trustidtype-nb-items)

Attributes Documentation#

internal_items_size_ (public)
trustIdType DeviceMemory::internal_items_size_ = 1e9
nb_pas_dt_ (public)
int DeviceMemory::nb_pas_dt_ = - 1
initial_free_ (private)
size_t DeviceMemory::initial_free_ = 0
memory_map_ (private)
map_t DeviceMemory::memory_map_