timemory 3.3.0
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::policy Namespace Reference

Classes

struct  input_archive
 Provides a static get() function which returns a shared pointer to an instance of the given archive format for input. Can also provides static functions for any global configuration options, if necessary. More...
 
struct  input_archive< cereal::JSONInputArchive, Api >
 
struct  input_archive< cereal::MinimalJSONOutputArchive, Api >
 
struct  input_archive< cereal::PrettyJSONOutputArchive, Api >
 
struct  instance_tracker
 Inherit from this policy to add reference counting support. Useful if you want to turn a global setting on/off when the number of components taking measurements has hit zero (e.g. all instances of component have called stop). Simply provides member functions and data values, increment/decrement is not automatically performed. In general, call instance_tracker::start or instance_tracker::stop inside of the components constructor if a component collects data and is using storage because instance(s) will be in the call-graph and thus, the instance count will always be > 0. Set the second template parameter to true if thread-local instance tracking is desired. More...
 
struct  instance_tracker< Tp, false >
 
struct  instance_tracker< Tp, true >
 
struct  output_archive
 Provides a static get() function which return a shared pointer to an instance of the given archive format for output. Can also provide static functions for any global configuration options for the archive format. For example, the (pretty) JSON output archive supports specification of the precision, indentation length, and the indentation character. More...
 
struct  output_archive< cereal::MinimalJSONOutputArchive, Api >
 partial specialization for MinimalJSONOutputArchive More...
 
struct  output_archive< cereal::PrettyJSONOutputArchive, Api >
 
struct  record_statistics
 Specification of how to accumulate statistics. This will not be used unless tim::trait::statistics has been assigned a type and tim::trait::record_statistics is true. Set tim::trait::permissive_statistics to allow implicit conversions, e.g. int -> size_t. More...
 
struct  record_statistics< CompT, void >
 

Typedefs

template<typename T >
using input_archive_t = input_archive< trait::input_archive_t< T >, TIMEMORY_API >
 
template<typename T >
using output_archive_t = output_archive< trait::output_archive_t< T >, TIMEMORY_API >
 

Class Documentation

◆ tim::policy::instance_tracker

struct tim::policy::instance_tracker
template<typename T, bool WithThreads = true>
struct tim::policy::instance_tracker< T, WithThreads >

Inherit from this policy to add reference counting support. Useful if you want to turn a global setting on/off when the number of components taking measurements has hit zero (e.g. all instances of component have called stop). Simply provides member functions and data values, increment/decrement is not automatically performed. In general, call instance_tracker::start or instance_tracker::stop inside of the components constructor if a component collects data and is using storage because instance(s) will be in the call-graph and thus, the instance count will always be > 0. Set the second template parameter to true if thread-local instance tracking is desired.

struct foo
: public base<foo, void>
, private policy::instance_tracker<foo, false>
{
using value_type = void;
using instance_tracker_t = policy::instance_tracker<foo, false>;
void start()
{
if(cnt == 0)
// start something
}
void stop()
{
if(cnt == 0)
// stop something
}
};
void stop(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:386
void start(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:316

Definition at line 406 of file types.hpp.

+ Collaboration diagram for tim::policy::instance_tracker< T, WithThreads >:

Typedef Documentation

◆ input_archive_t

Definition at line 456 of file types.hpp.

◆ output_archive_t

Definition at line 459 of file types.hpp.