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::data Namespace Reference

Namespaces

namespace  base
 

Classes

struct  entry
 
struct  handler
 
struct  header
 
struct  header_stream
 
class  ring_buffer_allocator
 allocator that uses array of (ring) buffers to coalesce memory. Requires This allocator propagates on container swap and container move assignment. Use TIMEMORY_RING_BUFFER_ALLOCATOR_BUFFER_COUNT env variable to specify the default number of allocations or use the set_buffer_count / set_buffer_count_cb. When a reserve is requested and the request is greater than the free spaces in the buffer, the free spaces are stored in a "dangling" array of spaces which are used when single allocations are requested. More...
 
class  shared_stateful_allocator
 Ensures that allocators which have state are not deleted until all handles to the allocator have been released. More...
 
struct  stream
 

Functions

template<typename... ArgsT>
void write_header (stream &_os, const std::string &_label, std::ios_base::fmtflags _fmt={}, int _width=0, int _prec=0, bool _center=true)
 
template<typename Tp >
void write_entry (stream &_os, const std::string &_label, const Tp &_value, bool c=false, bool l=false)
 
void write_entry (stream &_os, const std::string &_label, const std::string &_value, bool c=false, bool=false)
 
template<typename Tp >
void write_entry (stream &_os, const std::vector< std::string > &_label, const Tp &_value, bool c=false, bool l=false)
 
template<typename Tp >
void write_entry (stream &_os, const std::string &_label, const std::vector< std::string > &_value, bool c=false, bool l=false)
 
template<typename Tp , typename Up >
void write_entry (stream &_os, const std::string &_label, const std::pair< Tp, Up > &_value, bool c=false, bool l=false)
 
template<typename Tp , typename Up >
void write_entry (stream &_os, const std::vector< std::string > &_labels, const std::pair< Tp, Up > &_value, bool c=false, bool l=false)
 
template<typename Tp , typename... Alloc>
void write_entry (stream &_os, const std::string &_label, const std::vector< Tp, Alloc... > &_values, bool c=false, bool l=false)
 
template<typename Tp , typename... Alloc>
void write_entry (stream &_os, const std::vector< std::string > &_labels, const std::vector< Tp, Alloc... > &_values, bool c=false, bool l=false)
 
template<typename Tp , size_t N>
void write_entry (stream &_os, const std::string &_label, const std::array< Tp, N > &_values, bool c=false, bool l=false)
 
template<typename Tp , size_t N>
void write_entry (stream &_os, const std::vector< std::string > &_labels, const std::array< Tp, N > &_values, bool c=false, bool l=false)
 
template<typename... Types, size_t... Idx>
void write_entry (stream &_os, const std::string &_label, const std::tuple< Types... > &_values, index_sequence< Idx... >, bool c=false, bool l=false)
 
template<typename... Types, size_t... Idx>
void write_entry (stream &_os, const std::vector< std::string > &_labels, const std::tuple< Types... > &_values, index_sequence< Idx... >, bool c=false, bool l=false)
 
template<typename... Types>
void write_entry (stream &_os, const std::string &_labels, const std::tuple< Types... > &_values, bool c=false, bool l=false)
 
template<typename... Types>
void write_entry (stream &_os, const std::vector< std::string > &_labels, const std::tuple< Types... > &_values, bool c=false, bool l=false)
 

Function Documentation

◆ write_entry() [1/14]

template<typename Tp , size_t N>
void tim::data::write_entry ( stream _os,
const std::string &  _label,
const std::array< Tp, N > &  _values,
bool  c = false,
bool  l = false 
)

Definition at line 906 of file stream.hpp.

908{
909 for(const auto& itr : _values)
910 write_entry(_os, _label, itr, c, l);
911}
auto write_entry(Args &&... args)
Definition: stream.hpp:996

References write_entry().

◆ write_entry() [2/14]

template<typename Tp , typename Up >
void tim::data::write_entry ( stream _os,
const std::string &  _label,
const std::pair< Tp, Up > &  _value,
bool  c = false,
bool  l = false 
)

Definition at line 859 of file stream.hpp.

861{
862 write_entry(_os, _label, _value.first, c, l);
863 write_entry(_os, _label, _value.second, c, l);
864}

References write_entry().

◆ write_entry() [3/14]

void tim::data::write_entry ( stream _os,
const std::string &  _label,
const std::string &  _value,
bool  c = false,
bool  = false 
)
inline

Definition at line 827 of file stream.hpp.

829{
830 _os.set_name(_label);
831 _os(entry(_value, _os.get_header(_label, 0), c, true));
832}
data::entry entry
Definition: stream.hpp:980
void set_name(string_t v)
Definition: stream.hpp:326
header & get_header(const string_t &_key, int64_t _n)
Definition: stream.hpp:672

References tim::data::stream::get_header(), and tim::data::stream::set_name().

◆ write_entry() [4/14]

template<typename... Types, size_t... Idx>
void tim::data::write_entry ( stream _os,
const std::string &  _label,
const std::tuple< Types... > &  _values,
index_sequence< Idx... >  ,
bool  c = false,
bool  l = false 
)

Definition at line 929 of file stream.hpp.

931{
932 TIMEMORY_FOLD_EXPRESSION(write_entry(_os, _label, std::get<Idx>(_values), c, l));
933}
#define TIMEMORY_FOLD_EXPRESSION(...)
Definition: types.hpp:56

References TIMEMORY_FOLD_EXPRESSION, and write_entry().

◆ write_entry() [5/14]

template<typename Tp >
void tim::data::write_entry ( stream _os,
const std::string &  _label,
const std::vector< std::string > &  _value,
bool  c = false,
bool  l = false 
)

Definition at line 848 of file stream.hpp.

850{
851 for(const auto& itr : _value)
852 write_entry(_os, _label, itr, c, l);
853}

References write_entry().

◆ write_entry() [6/14]

template<typename Tp , typename... Alloc>
void tim::data::write_entry ( stream _os,
const std::string &  _label,
const std::vector< Tp, Alloc... > &  _values,
bool  c = false,
bool  l = false 
)

Definition at line 882 of file stream.hpp.

884{
885 for(const auto& itr : _values)
886 write_entry(_os, _label, itr, c, l);
887}

References write_entry().

◆ write_entry() [7/14]

template<typename Tp >
void tim::data::write_entry ( stream _os,
const std::string &  _label,
const Tp &  _value,
bool  c = false,
bool  l = false 
)

Definition at line 817 of file stream.hpp.

819{
820 _os.set_name(_label);
821 _os(entry(_value, _os.get_header(_label, 0), c, l));
822}

References tim::data::stream::get_header(), and tim::data::stream::set_name().

Referenced by tim::utility::write_entry(), and write_entry().

◆ write_entry() [8/14]

template<typename... Types>
void tim::data::write_entry ( stream _os,
const std::string &  _labels,
const std::tuple< Types... > &  _values,
bool  c = false,
bool  l = false 
)

Definition at line 952 of file stream.hpp.

954{
955 constexpr size_t N = sizeof...(Types);
956 write_entry(_os, _labels, _values, make_index_sequence<N>{}, c, l);
957}
std::make_integer_sequence< size_t, Num > make_index_sequence
Alias template make_index_sequence.
Definition: types.hpp:182

References write_entry().

◆ write_entry() [9/14]

template<typename Tp >
void tim::data::write_entry ( stream _os,
const std::vector< std::string > &  _label,
const Tp &  _value,
bool  c = false,
bool  l = false 
)

Definition at line 838 of file stream.hpp.

840{
841 write_entry(_os, _label.front(), _value, c, l);
842}

References write_entry().

◆ write_entry() [10/14]

template<typename Tp , size_t N>
void tim::data::write_entry ( stream _os,
const std::vector< std::string > &  _labels,
const std::array< Tp, N > &  _values,
bool  c = false,
bool  l = false 
)

Definition at line 917 of file stream.hpp.

919{
920 size_t _L = _labels.size();
921 for(size_t i = 0; i < N; ++i)
922 write_entry(_os, _labels.at(i % _L), _values.at(i), c, l);
923}

References write_entry().

◆ write_entry() [11/14]

template<typename Tp , typename Up >
void tim::data::write_entry ( stream _os,
const std::vector< std::string > &  _labels,
const std::pair< Tp, Up > &  _value,
bool  c = false,
bool  l = false 
)

Definition at line 870 of file stream.hpp.

872{
873 size_t _L = _labels.size();
874 write_entry(_os, _labels.at(0), _value.first, c, l);
875 write_entry(_os, _labels.at(1 % _L), _value.second, c, l);
876}

References write_entry().

◆ write_entry() [12/14]

template<typename... Types>
void tim::data::write_entry ( stream _os,
const std::vector< std::string > &  _labels,
const std::tuple< Types... > &  _values,
bool  c = false,
bool  l = false 
)

Definition at line 963 of file stream.hpp.

965{
966 constexpr size_t N = sizeof...(Types);
967 write_entry(_os, _labels, _values, make_index_sequence<N>{}, c, l);
968}

References write_entry().

◆ write_entry() [13/14]

template<typename... Types, size_t... Idx>
void tim::data::write_entry ( stream _os,
const std::vector< std::string > &  _labels,
const std::tuple< Types... > &  _values,
index_sequence< Idx... >  ,
bool  c = false,
bool  l = false 
)

Definition at line 939 of file stream.hpp.

942{
943 size_t _L = _labels.size();
945 write_entry(_os, _labels.at(Idx % _L), std::get<Idx>(_values), c, l));
946}

References TIMEMORY_FOLD_EXPRESSION, and write_entry().

◆ write_entry() [14/14]

template<typename Tp , typename... Alloc>
void tim::data::write_entry ( stream _os,
const std::vector< std::string > &  _labels,
const std::vector< Tp, Alloc... > &  _values,
bool  c = false,
bool  l = false 
)

Definition at line 893 of file stream.hpp.

895{
896 size_t _L = _labels.size();
897 size_t N = _values.size();
898 for(size_t i = 0; i < N; ++i)
899 write_entry(_os, _labels.at(i % _L), _values.at(i), c, l);
900}

References write_entry().

◆ write_header()

template<typename... ArgsT>
void tim::data::write_header ( stream _os,
const std::string &  _label,
std::ios_base::fmtflags  _fmt = {},
int  _width = 0,
int  _prec = 0,
bool  _center = true 
)

Definition at line 806 of file stream.hpp.

806 {},
807 int _width = 0, int _prec = 0, bool _center = true)
808{
809 _os.set_name(_label);
810 _os(header(_label, _fmt, _width, _prec, _center));
811}
data::header header
Definition: stream.hpp:981

Referenced by tim::utility::write_header().