TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
DeviceMemory Struct Reference

#include <DeviceMemory.h>

Public Member Functions

 DeviceMemory ()=delete

Static Public Member Functions

static size_t allocatedBytesOnDevice ()
static size_t deviceMemGetInfo (bool)
static map_t & getMemoryMap ()
static bool isAllocatedOnDevice (void *)
static void * addrOnDevice (void *)
static void add (void *ptr, void *device_ptr, trustIdType bytes)
static void del (void *ptr)
static void printMemoryMap ()
static bool warning (trustIdType nb_items)

Static Public Attributes

static trustIdType internal_items_size_ = 1e9
static int nb_pas_dt_ = -1

Detailed Description

Definition at line 30 of file DeviceMemory.h.

Constructor & Destructor Documentation

◆ DeviceMemory()

DeviceMemory::DeviceMemory ( )
delete

Member Function Documentation

◆ add()

void DeviceMemory::add ( void * ptr,
void * device_ptr,
trustIdType bytes )
static

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

Definition at line 100 of file DeviceMemory.cpp.

◆ addrOnDevice()

void * DeviceMemory::addrOnDevice ( void * ptr)
static

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

Definition at line 70 of file DeviceMemory.cpp.

◆ allocatedBytesOnDevice()

size_t DeviceMemory::allocatedBytesOnDevice ( )
static

Definition at line 48 of file DeviceMemory.cpp.

◆ del()

void DeviceMemory::del ( void * ptr)
static

Delete a line into the memory_map_

Definition at line 115 of file DeviceMemory.cpp.

◆ deviceMemGetInfo()

size_t DeviceMemory::deviceMemGetInfo ( bool print_total)
static

Definition at line 34 of file DeviceMemory.cpp.

◆ getMemoryMap()

map_t & DeviceMemory::getMemoryMap ( )
inlinestatic

Definition at line 38 of file DeviceMemory.h.

◆ isAllocatedOnDevice()

bool DeviceMemory::isAllocatedOnDevice ( void * ptr)
static

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

Definition at line 58 of file DeviceMemory.cpp.

◆ printMemoryMap()

void DeviceMemory::printMemoryMap ( )
static

Print the memory map for debug

Definition at line 128 of file DeviceMemory.cpp.

◆ warning()

bool DeviceMemory::warning ( trustIdType nb_items)
static

Definition at line 142 of file DeviceMemory.cpp.

Member Data Documentation

◆ internal_items_size_

trustIdType DeviceMemory::internal_items_size_ = 1e9
static

Definition at line 44 of file DeviceMemory.h.

◆ nb_pas_dt_

int DeviceMemory::nb_pas_dt_ = -1
static

Definition at line 45 of file DeviceMemory.h.


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