DeviceMemory#

#include <DeviceMemory.h>
Brief description

How to reference this class#

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

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

Detailed description#

List of Public Methods#

List of Public Static Methods#

Complete Member Function Documentation#

DeviceMemory#

Definition
DeviceMemory::DeviceMemory()=delete
Brief description
Detailed description
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`DeviceMemory::DeviceMemory()=delete <devicememory-public-devicememory-devicememory-equal-delete>`
[DeviceMemory::DeviceMemory()=delete](#devicememory-public-devicememory-devicememory-equal-delete)

add#

Definition
void DeviceMemory::add(void *ptr, void *device_ptr, trustIdType bytes)
Brief description
Detailed description

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

References
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void DeviceMemory::add(void *ptr, void *device_ptr, trustIdType bytes) <devicememory-public-static-void-devicememory-add-void-ptr-ptr-void-ptr-device-ptr-trustidtype-bytes>`
[void DeviceMemory::add(void *ptr, void *device_ptr, trustIdType bytes)](#devicememory-public-static-void-devicememory-add-void-ptr-ptr-void-ptr-device-ptr-trustidtype-bytes)

addrOnDevice#

Definition
void * DeviceMemory::addrOnDevice(void *)
Brief description
Detailed description

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 reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void * DeviceMemory::addrOnDevice(void *) <devicememory-public-static-void-ptr-devicememory-addrondevice-void-ptr>`
[void * DeviceMemory::addrOnDevice(void *)](#devicememory-public-static-void-ptr-devicememory-addrondevice-void-ptr)

allocatedBytesOnDevice#

Definition
size_t DeviceMemory::allocatedBytesOnDevice()
Brief description
Detailed description
References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`size_t DeviceMemory::allocatedBytesOnDevice() <devicememory-public-static-size-t-devicememory-allocatedbytesondevice>`
[size_t DeviceMemory::allocatedBytesOnDevice()](#devicememory-public-static-size-t-devicememory-allocatedbytesondevice)

del#

Definition
void DeviceMemory::del(void *ptr)
Brief description
Detailed description

Delete a line into the memory_map_

References
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void DeviceMemory::del(void *ptr) <devicememory-public-static-void-devicememory-del-void-ptr-ptr>`
[void DeviceMemory::del(void *ptr)](#devicememory-public-static-void-devicememory-del-void-ptr-ptr)

deviceMemGetInfo#

Definition
size_t DeviceMemory::deviceMemGetInfo(bool)
Brief description
Detailed description
References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`size_t DeviceMemory::deviceMemGetInfo(bool) <devicememory-public-static-size-t-devicememory-devicememgetinfo-bool>`
[size_t DeviceMemory::deviceMemGetInfo(bool)](#devicememory-public-static-size-t-devicememory-devicememgetinfo-bool)

getMemoryMap#

Definition
static map_t & DeviceMemory::getMemoryMap()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static map_t & DeviceMemory::getMemoryMap() <devicememory-public-static-static-map-t-ref-devicememory-getmemorymap>`
[static map_t & DeviceMemory::getMemoryMap()](#devicememory-public-static-static-map-t-ref-devicememory-getmemorymap)

isAllocatedOnDevice#

Definition
bool DeviceMemory::isAllocatedOnDevice(void *)
Brief description
Detailed description

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

How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`bool DeviceMemory::isAllocatedOnDevice(void *) <devicememory-public-static-bool-devicememory-isallocatedondevice-void-ptr>`
[bool DeviceMemory::isAllocatedOnDevice(void *)](#devicememory-public-static-bool-devicememory-isallocatedondevice-void-ptr)

printMemoryMap#

Definition
void DeviceMemory::printMemoryMap()
Brief description
Detailed description

Print the memory map for debug

References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void DeviceMemory::printMemoryMap() <devicememory-public-static-void-devicememory-printmemorymap>`
[void DeviceMemory::printMemoryMap()](#devicememory-public-static-void-devicememory-printmemorymap)

warning#

Definition
bool DeviceMemory::warning(trustIdType nb_items)
Brief description
Detailed description
References
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`bool DeviceMemory::warning(trustIdType nb_items) <devicememory-public-static-bool-devicememory-warning-trustidtype-nb-items>`
[bool DeviceMemory::warning(trustIdType nb_items)](#devicememory-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_