![]() |
IgANet
IgANets - Isogeometric Analysis Networks
|
Memory debugger. More...
#include </home/runner/work/iganet/iganet/include/memory.hpp>
Classes | |
struct | MemoryObject |
Memory object. More... | |
Public Member Functions | |
MemoryDebugger () | |
Default constructor. | |
template<typename T , std::size_t N> | |
void | add (const std::string &name, const std::array< T, N > &array) |
Registers std::array to memory debugger. | |
template<typename T > | |
void | add (const std::string &name, const T &obj) |
Registers generic type to memory debugger. | |
void | add (const std::string &name, const torch::Tensor &tensor) |
Registers torch::Tensor to memory debugger. | |
void | clear () |
Clears memory debugger. | |
void | pretty_print (std::ostream &os=Log(log::info)) const |
Returns a string representation of the memory debugger. | |
Private Member Functions | |
std::string | convert_bytes (int64_t bytes) const |
Converts bytes into best human-readable unit. | |
Private Attributes | |
int64_t | bytes_ |
Counter holding the memory of registered objects in bytes. | |
int64_t | counter_ |
Counter holding the number of registered objects. | |
std::chrono::high_resolution_clock::time_point | init_ |
Reference time point. | |
std::map< std::chrono::high_resolution_clock::time_point, MemoryObject > | objects_ |
Map holding the list of registered objects. | |
Memory debugger.
|
inline |
Default constructor.
|
inline |
Registers std::array to memory debugger.
|
inline |
Registers generic type to memory debugger.
|
inline |
Registers torch::Tensor to memory debugger.
|
inline |
Clears memory debugger.
|
inlineprivate |
Converts bytes into best human-readable unit.
|
inline |
Returns a string representation of the memory debugger.
|
private |
Counter holding the memory of registered objects in bytes.
|
private |
Counter holding the number of registered objects.
|
private |
Reference time point.
|
private |
Map holding the list of registered objects.