STORMM Source Documentation
|
A struct for storing records of all active Hybrid memory arrays. This will also store tables of identifiers that indicate the most recent state of a group of Hybrid arrays, which can be accessed by structs of pointers to make sure that they reflect the most recent state of all their underlying arrays. More...
#include <hybrid.h>
Public Member Functions | |
Ledger () | |
Constructor initializes the number of entries and allocations. | |
~Ledger ()=default | |
Default destructor. | |
int | getActiveEntryCount () const |
Retrieve the number of entries for Hybrid memory objects currently stored. | |
int | getSerialNumber () |
Produce a number corresponding to some unused entry in the ledger. This will be either the lowest positive integer not yet assigned, or if some integers once assigned to destroyed Hybrid objects have been freed up, the first such integer from that list. | |
llint | getTotalExpedited () const |
Retrieve the total allocation of decoupled memory, in bytes. | |
llint | getTotalDecoupled () const |
Retrieve the total allocation of decoupled memory, in bytes. | |
llint | getTotalUnified () const |
Retrieve the total allocation of unified memory, in bytes. | |
llint | getTotalHostOnly () const |
Retrieve the total allocation of host-only memory, in bytes. | |
llint | getTotalDevcOnly () const |
Retrieve the total allocation of device-only memory, in bytes. | |
llint | getTotalHostMounted () const |
Retrieve the total allocation of host-mounted memory, in bytes. | |
void | setEntry (int serno, HybridKind kind, const HybridLabel hlbl, size_t length, size_t element_size, int allocations) |
Begin a catalog for the place of a Hybrid object among many others. This is to be called once for each object, in its constructor. | |
void | unsetEntry (int serno) |
Remove a Hybrid object from the catalog. This is to be called by the Hybrid object's destructor. | |
void | logMemory (size_t capacity, size_t element_size, HybridFormat fmt, const HybridLabel hlbl, llint multiplier) |
Log each tagged Hybrid array in the ledger. | |
bool | testActive (int serno) |
Query an index in the ledger to determine whether it catalogs an active Hybrid object. | |
int | getAllocations (int serno) |
Query the number of times the Hybrid object catalogged in a particular entry has had its data arrays allocated. | |
void | printMemoryProfile (int n_display=8, llint display_threshold=mega) |
Print the current memory usage of all Hybrid objects. The function will print totals followed by specific usages. | |
LedgerEntry | getEntry (int index) const |
Get information about a single entry of a ledger. | |
std::vector< LedgerEntry > | getEntry (const std::string &name) const |
A struct for storing records of all active Hybrid memory arrays. This will also store tables of identifiers that indicate the most recent state of a group of Hybrid arrays, which can be accessed by structs of pointers to make sure that they reflect the most recent state of all their underlying arrays.
LedgerEntry stormm::card::Ledger::getEntry | ( | int | index | ) | const |
Get information about a single entry of a ledger.
Overloaded:
void stormm::card::Ledger::printMemoryProfile | ( | int | n_display = 8, |
llint | display_threshold = mega ) |
Print the current memory usage of all Hybrid objects. The function will print totals followed by specific usages.
void stormm::card::Ledger::setEntry | ( | int | serno, |
HybridKind | kind, | ||
const HybridLabel | hlbl, | ||
size_t | length, | ||
size_t | element_size, | ||
int | allocations ) |
bool stormm::card::Ledger::testActive | ( | int | serno | ) |
void stormm::card::Ledger::unsetEntry | ( | int | serno | ) |