timemory  3.2.1
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::virtual_memory Struct Reference

this struct extracts the virtual memory usage More...

#include "timemory/components/rusage/components.hpp"

+ Collaboration diagram for tim::component::virtual_memory:

Public Types

using value_type = int64_t
 
using base_type = base< virtual_memory, value_type >
 

Public Member Functions

double get () const
 
double get_display () const
 
void start ()
 
void stop ()
 
void sample ()
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static value_type record ()
 

Detailed Description

this struct extracts the virtual memory usage

Definition at line 432 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ value_type

Definition at line 434 of file components.hpp.

Member Function Documentation

◆ description()

static std::string tim::component::virtual_memory::description ( )
inlinestatic

Definition at line 438 of file components.hpp.

438 { return "Records the change in virtual memory"; }

◆ get()

double tim::component::virtual_memory::get ( ) const
inline

Definition at line 440 of file components.hpp.

441  {
442  auto val = base_type::load();
443  return val / static_cast<double>(base_type::get_unit());
444  }
decltype(auto) load()
static int64_t get_unit()

References tim::component::base< Tp, Value >::get_unit(), and tim::component::base< Tp, Value >::load().

Referenced by get_display().

◆ get_display()

double tim::component::virtual_memory::get_display ( ) const
inline

Definition at line 445 of file components.hpp.

445 { return get(); }

References get().

◆ label()

static std::string tim::component::virtual_memory::label ( )
inlinestatic

Definition at line 437 of file components.hpp.

437 { return "virtual_memory"; }

◆ record()

static value_type tim::component::virtual_memory::record ( )
inlinestatic

Definition at line 439 of file components.hpp.

439 { return get_virt_mem(); }

Referenced by sample(), start(), and stop().

◆ sample()

void tim::component::virtual_memory::sample ( )
inline

Definition at line 452 of file components.hpp.

452 { accum = value = std::max<int64_t>(value, record()); }
static value_type record()
Definition: components.hpp:439

References record().

◆ start()

void tim::component::virtual_memory::start ( )
inline

Definition at line 446 of file components.hpp.

446 { value = record(); }

References record().

◆ stop()

void tim::component::virtual_memory::stop ( )
inline

Definition at line 447 of file components.hpp.

448  {
449  value = (record() - value);
450  accum += value;
451  }

References record().


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