Block-Structured AMR Software Framework
amrex::MemProfiler Class Reference

#include <AMReX_MemProfiler.H>

Classes

struct  Builds
 
struct  Bytes
 
struct  MemInfo
 
struct  NBuildsInfo
 

Public Member Functions

 MemProfiler (const MemProfiler &)=delete
 
MemProfileroperator= (const MemProfiler &)=delete
 
 MemProfiler ()
 
 ~MemProfiler ()
 

Static Public Member Functions

static void add (const std::string &name, std::function< MemInfo()> &&f)
 
static void add (const std::string &name, std::function< NBuildsInfo()> &&f)
 
static void report (const std::string &prefix=std::string())
 
static void Finalize ()
 

Private Member Functions

void report_ (const std::string &prefix, const std::string &memory_log_name) const
 

Static Private Member Functions

static MemProfilergetInstance ()
 

Private Attributes

std::vector< std::string > the_names
 
std::vector< std::function< MemInfo()> > the_funcs
 
std::vector< std::string > the_names_builds
 
std::vector< std::function< NBuildsInfo()> > the_funcs_builds
 

Static Private Attributes

static std::unique_ptr< MemProfilerthe_instance = nullptr
 

Friends

std::ostream & operator<< (std::ostream &os, const MemProfiler::Bytes &bytes)
 
std::ostream & operator<< (std::ostream &os, const MemProfiler::Builds &builds)
 

Constructor & Destructor Documentation

◆ MemProfiler() [1/2]

amrex::MemProfiler::MemProfiler ( const MemProfiler )
delete

◆ MemProfiler() [2/2]

amrex::MemProfiler::MemProfiler ( )
inline

◆ ~MemProfiler()

amrex::MemProfiler::~MemProfiler ( )
inline

Member Function Documentation

◆ add() [1/2]

void amrex::MemProfiler::add ( const std::string &  name,
std::function< MemInfo()> &&  f 
)
static

◆ add() [2/2]

void amrex::MemProfiler::add ( const std::string &  name,
std::function< NBuildsInfo()> &&  f 
)
static

◆ Finalize()

void amrex::MemProfiler::Finalize ( )
static

◆ getInstance()

MemProfiler & amrex::MemProfiler::getInstance ( )
staticprivate

◆ operator=()

MemProfiler& amrex::MemProfiler::operator= ( const MemProfiler )
delete

◆ report()

void amrex::MemProfiler::report ( const std::string &  prefix = std::string())
static

◆ report_()

void amrex::MemProfiler::report_ ( const std::string &  prefix,
const std::string &  memory_log_name 
) const
private

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  os,
const MemProfiler::Builds builds 
)
friend

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  os,
const MemProfiler::Bytes bytes 
)
friend

Member Data Documentation

◆ the_funcs

std::vector<std::function<MemInfo()> > amrex::MemProfiler::the_funcs
private

◆ the_funcs_builds

std::vector<std::function<NBuildsInfo()> > amrex::MemProfiler::the_funcs_builds
private

◆ the_instance

std::unique_ptr< MemProfiler > amrex::MemProfiler::the_instance = nullptr
staticprivate

◆ the_names

std::vector<std::string> amrex::MemProfiler::the_names
private

◆ the_names_builds

std::vector<std::string> amrex::MemProfiler::the_names_builds
private

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