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::node::graph< Tp > Struct Template Reference

This is the compact representation of a measurement in the call-graph. More...

#include "timemory/storage/node.hpp"

+ Collaboration diagram for tim::node::graph< Tp >:

Public Types

using this_type = graph
 
using base_type = typename data< Tp >::node_type
 
using data_value_type = typename Tp::value_type
 
using data_base_type = typename Tp::base_type
 
using stats_type = typename data< Tp >::stats_type
 
using string_t = std::string
 

Public Member Functions

 graph ()
 
 graph (uint64_t _id, const Tp &_obj, int64_t _depth, uint32_t _tid, uint32_t _pid=process::get_id(), bool _is_dummy=false)
 
 ~graph ()=default
 
 graph (const graph &)=default
 
 graph (graph &&) noexcept=default
 
graphoperator= (const graph &)=default
 
graphoperator= (graph &&) noexcept=default
 
bool operator== (const graph &rhs) const
 
bool operator!= (const graph &rhs) const
 
this_typeoperator+= (const this_type &rhs)
 
this_typeoperator-= (const this_type &rhs)
 
bool & is_dummy ()
 denotes this is a placeholder for synchronization More...
 
uint32_t & tid ()
 thread identifier More...
 
uint32_t & pid ()
 process identifier More...
 
uint64_t & id ()
 hash identifer More...
 
int64_t & depth ()
 depth in call-graph More...
 
Tp & obj ()
 this is the instance that gets updated in call-graph More...
 
stats_typestats ()
 statistics data for entry in call-graph More...
 
const bool & is_dummy () const
 
const uint32_t & tid () const
 
const uint32_t & pid () const
 
const uint64_t & id () const
 
const int64_t & depth () const
 
const Tp & obj () const
 
const stats_typestats () const
 
auto & data ()
 
auto & hash ()
 
const auto & data () const
 
const auto & hash () const
 

Static Public Member Functions

static Tp get_dummy ()
 

Detailed Description

template<typename Tp>
struct tim::node::graph< Tp >

This is the compact representation of a measurement in the call-graph.

Template Parameters
TpComponent type

Definition at line 138 of file node.hpp.

Member Typedef Documentation

◆ base_type

template<typename Tp >
using tim::node::graph< Tp >::base_type = typename data<Tp>::node_type

Definition at line 141 of file node.hpp.

◆ data_base_type

template<typename Tp >
using tim::node::graph< Tp >::data_base_type = typename Tp::base_type

Definition at line 143 of file node.hpp.

◆ data_value_type

template<typename Tp >
using tim::node::graph< Tp >::data_value_type = typename Tp::value_type

Definition at line 142 of file node.hpp.

◆ stats_type

template<typename Tp >
using tim::node::graph< Tp >::stats_type = typename data<Tp>::stats_type

Definition at line 144 of file node.hpp.

◆ string_t

template<typename Tp >
using tim::node::graph< Tp >::string_t = std::string

Definition at line 145 of file node.hpp.

◆ this_type

template<typename Tp >
using tim::node::graph< Tp >::this_type = graph

Definition at line 140 of file node.hpp.

Constructor & Destructor Documentation

◆ graph() [1/4]

template<typename Tp >
tim::node::graph< Tp >::graph

Definition at line 411 of file node.hpp.

412: base_type(false, threading::get_id(), process::get_id(), 0, 0, Tp{}, stats_type{})
413{}
typename data< Tp >::stats_type stats_type
Definition: node.hpp:144
typename data< Tp >::node_type base_type
Definition: node.hpp:141

◆ graph() [2/4]

template<typename Tp >
tim::node::graph< Tp >::graph ( uint64_t  _id,
const Tp &  _obj,
int64_t  _depth,
uint32_t  _tid,
uint32_t  _pid = process::get_id(),
bool  _is_dummy = false 
)

Definition at line 418 of file node.hpp.

420: base_type(_is_dummy, _tid, _pid, _id, _depth, _obj, stats_type{})
421{}

◆ ~graph()

template<typename Tp >
tim::node::graph< Tp >::~graph ( )
default

◆ graph() [3/4]

template<typename Tp >
tim::node::graph< Tp >::graph ( const graph< Tp > &  )
default

◆ graph() [4/4]

template<typename Tp >
tim::node::graph< Tp >::graph ( graph< Tp > &&  )
defaultnoexcept

Member Function Documentation

◆ data() [1/2]

template<typename Tp >
auto & tim::node::graph< Tp >::data ( )
inline

Definition at line 208 of file node.hpp.

208{ return this->obj(); }
Tp & obj()
this is the instance that gets updated in call-graph
Definition: node.hpp:195

References tim::node::graph< Tp >::obj().

Referenced by tim::node::tree< Tp >::operator=().

◆ data() [2/2]

template<typename Tp >
const auto & tim::node::graph< Tp >::data ( ) const
inline

Definition at line 210 of file node.hpp.

210{ return this->obj(); }

References tim::node::graph< Tp >::obj().

◆ depth() [1/2]

template<typename Tp >
int64_t & tim::node::graph< Tp >::depth ( )
inline

depth in call-graph

Definition at line 192 of file node.hpp.

192{ return std::get<4>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator=(), tim::node::graph< Tp >::operator==(), and tim::cereal::save().

◆ depth() [2/2]

template<typename Tp >
const int64_t & tim::node::graph< Tp >::depth ( ) const
inline

Definition at line 204 of file node.hpp.

204{ return std::get<4>(*this); }

◆ get_dummy()

template<typename Tp >
Tp tim::node::graph< Tp >::get_dummy
static

Definition at line 445 of file node.hpp.

446{
447 return operation::dummy<Tp>{}();
448}

◆ hash() [1/2]

template<typename Tp >
auto & tim::node::graph< Tp >::hash ( )
inline

Definition at line 209 of file node.hpp.

209{ return this->id(); }
uint64_t & id()
hash identifer
Definition: node.hpp:189

References tim::node::graph< Tp >::id().

Referenced by tim::node::tree< Tp >::operator=().

◆ hash() [2/2]

template<typename Tp >
const auto & tim::node::graph< Tp >::hash ( ) const
inline

Definition at line 211 of file node.hpp.

211{ return this->id(); }

References tim::node::graph< Tp >::id().

◆ id() [1/2]

template<typename Tp >
uint64_t & tim::node::graph< Tp >::id ( )
inline

hash identifer

Definition at line 189 of file node.hpp.

189{ return std::get<3>(*this); }

Referenced by tim::node::graph< Tp >::hash(), tim::cereal::load(), tim::node::graph< Tp >::operator==(), and tim::cereal::save().

◆ id() [2/2]

template<typename Tp >
const uint64_t & tim::node::graph< Tp >::id ( ) const
inline

Definition at line 203 of file node.hpp.

203{ return std::get<3>(*this); }

◆ is_dummy() [1/2]

template<typename Tp >
bool & tim::node::graph< Tp >::is_dummy ( )
inline

denotes this is a placeholder for synchronization

Definition at line 180 of file node.hpp.

180{ return std::get<0>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator=(), and tim::cereal::save().

◆ is_dummy() [2/2]

template<typename Tp >
const bool & tim::node::graph< Tp >::is_dummy ( ) const
inline

Definition at line 200 of file node.hpp.

200{ return std::get<0>(*this); }

◆ obj() [1/2]

template<typename Tp >
Tp & tim::node::graph< Tp >::obj ( )
inline

this is the instance that gets updated in call-graph

Definition at line 195 of file node.hpp.

195{ return std::get<5>(*this); }

Referenced by tim::node::graph< Tp >::data(), tim::cereal::load(), tim::node::graph< Tp >::operator+=(), tim::node::graph< Tp >::operator-=(), and tim::cereal::save().

◆ obj() [2/2]

template<typename Tp >
const Tp & tim::node::graph< Tp >::obj ( ) const
inline

Definition at line 205 of file node.hpp.

205{ return std::get<5>(*this); }

◆ operator!=()

template<typename Tp >
bool tim::node::graph< Tp >::operator!= ( const graph< Tp > &  rhs) const

Definition at line 436 of file node.hpp.

437{
438 return !(*this == rhs);
439}

◆ operator+=()

template<typename Tp >
this_type & tim::node::graph< Tp >::operator+= ( const this_type rhs)
inline

Definition at line 164 of file node.hpp.

165 {
166 obj() += rhs.obj();
167 stats() += rhs.stats();
168 return *this;
169 }
stats_type & stats()
statistics data for entry in call-graph
Definition: node.hpp:198

References tim::node::graph< Tp >::obj(), and tim::node::graph< Tp >::stats().

◆ operator-=()

template<typename Tp >
this_type & tim::node::graph< Tp >::operator-= ( const this_type rhs)
inline

Definition at line 171 of file node.hpp.

172 {
173 obj() -= rhs.obj();
174 stats() -= rhs.stats();
175 return *this;
176 }

References tim::node::graph< Tp >::obj(), and tim::node::graph< Tp >::stats().

◆ operator=() [1/2]

template<typename Tp >
graph & tim::node::graph< Tp >::operator= ( const graph< Tp > &  )
default

◆ operator=() [2/2]

template<typename Tp >
graph & tim::node::graph< Tp >::operator= ( graph< Tp > &&  )
defaultnoexcept

◆ operator==()

template<typename Tp >
bool tim::node::graph< Tp >::operator== ( const graph< Tp > &  rhs) const

Definition at line 427 of file node.hpp.

428{
429 return (id() == rhs.id() && depth() == rhs.depth());
430}
int64_t & depth()
depth in call-graph
Definition: node.hpp:192

References tim::node::graph< Tp >::depth(), and tim::node::graph< Tp >::id().

◆ pid() [1/2]

template<typename Tp >
uint32_t & tim::node::graph< Tp >::pid ( )
inline

process identifier

Definition at line 186 of file node.hpp.

186{ return std::get<2>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator=(), and tim::cereal::save().

◆ pid() [2/2]

template<typename Tp >
const uint32_t & tim::node::graph< Tp >::pid ( ) const
inline

Definition at line 202 of file node.hpp.

202{ return std::get<2>(*this); }

◆ stats() [1/2]

template<typename Tp >
stats_type & tim::node::graph< Tp >::stats ( )
inline

statistics data for entry in call-graph

Definition at line 198 of file node.hpp.

198{ return std::get<6>(*this); }

Referenced by tim::cereal::load(), tim::node::graph< Tp >::operator+=(), tim::node::graph< Tp >::operator-=(), tim::node::tree< Tp >::operator=(), and tim::cereal::save().

◆ stats() [2/2]

template<typename Tp >
const stats_type & tim::node::graph< Tp >::stats ( ) const
inline

Definition at line 206 of file node.hpp.

206{ return std::get<6>(*this); }

◆ tid() [1/2]

template<typename Tp >
uint32_t & tim::node::graph< Tp >::tid ( )
inline

thread identifier

Definition at line 183 of file node.hpp.

183{ return std::get<1>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator=(), and tim::cereal::save().

◆ tid() [2/2]

template<typename Tp >
const uint32_t & tim::node::graph< Tp >::tid ( ) const
inline

Definition at line 201 of file node.hpp.

201{ return std::get<1>(*this); }

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