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::component::base_data< Tp, 2 > Struct Template Reference

#include "timemory/components/base/data.hpp"

+ Collaboration diagram for tim::component::base_data< Tp, 2 >:

Public Types

using empty_type = std::tuple<>
 
using value_type = Tp
 
using accum_type = Tp
 
using last_type = empty_type
 

Public Member Functions

const value_typeget_value () const
 
const value_typeget_accum () const
 
const value_typeget_last () const
 
void set_value (value_type v)
 
void set_accum (value_type v)
 
void set_last (value_type)
 
 base_data ()=default
 
 ~base_data ()=default
 
base_dataoperator= (base_data &&)=default
 
 base_data (base_data &&)=default
 
 base_data (const base_data &rhs)=default
 
base_dataoperator= (const base_data &rhs)=default
 
template<typename ArchiveT >
void serialize (ArchiveT &ar, const unsigned int=0)
 
value_typeload (bool is_transient)
 
const value_typeload (bool is_transient) const
 
void plus (const value_type &rhs)
 
void minus (const value_type &rhs)
 
void multiply (const value_type &rhs)
 
void divide (const value_type &rhs)
 
template<typename Up >
auto plus (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
 
template<typename Up >
auto minus (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
 
template<typename Up >
auto multiply (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
 
template<typename Up >
auto divide (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
 
value_typelast ()
 

Protected Member Functions

void reset ()
 

Protected Attributes

value_type value = Tp{}
 
value_type accum = Tp{}
 

Friends

template<typename Up , typename ValueT >
struct base
 

Detailed Description

template<typename Tp>
struct tim::component::base_data< Tp, 2 >

Definition at line 188 of file data.hpp.

Member Typedef Documentation

◆ accum_type

template<typename Tp >
using tim::component::base_data< Tp, 2 >::accum_type = Tp

Definition at line 195 of file data.hpp.

◆ empty_type

template<typename Tp >
using tim::component::base_data< Tp, 2 >::empty_type = std::tuple<>

Definition at line 193 of file data.hpp.

◆ last_type

template<typename Tp >
using tim::component::base_data< Tp, 2 >::last_type = empty_type

Definition at line 196 of file data.hpp.

◆ value_type

template<typename Tp >
using tim::component::base_data< Tp, 2 >::value_type = Tp

Definition at line 194 of file data.hpp.

Constructor & Destructor Documentation

◆ base_data() [1/3]

template<typename Tp >
tim::component::base_data< Tp, 2 >::base_data ( )
default

◆ ~base_data()

template<typename Tp >
tim::component::base_data< Tp, 2 >::~base_data ( )
default

◆ base_data() [2/3]

template<typename Tp >
tim::component::base_data< Tp, 2 >::base_data ( base_data< Tp, 2 > &&  )
default

◆ base_data() [3/3]

template<typename Tp >
tim::component::base_data< Tp, 2 >::base_data ( const base_data< Tp, 2 > &  rhs)
default

Member Function Documentation

◆ divide() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 2 >::divide ( const value_type rhs)
inline

Definition at line 247 of file data.hpp.

248 {
251 }
static decltype(auto) divide(type &_l, const V &_r)
Definition: compute.hpp:111

References tim::math::compute< Tp, Up >::divide().

◆ divide() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 2 >::divide ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 282 of file data.hpp.

284 {
285 value =
286 math::compute<value_type>::divide(value, std::forward<Up>(rhs).get_value());
287 accum =
288 math::compute<value_type>::divide(accum, std::forward<Up>(rhs).get_accum());
289 }
const value_type & get_value() const
Definition: data.hpp:198
const value_type & get_accum() const
Definition: data.hpp:199

References tim::math::compute< Tp, Up >::divide().

◆ get_accum()

template<typename Tp >
const value_type & tim::component::base_data< Tp, 2 >::get_accum ( ) const
inline

Definition at line 199 of file data.hpp.

199{ return accum; }

◆ get_last()

template<typename Tp >
const value_type & tim::component::base_data< Tp, 2 >::get_last ( ) const
inline

Definition at line 200 of file data.hpp.

200{ return value; }

◆ get_value()

template<typename Tp >
const value_type & tim::component::base_data< Tp, 2 >::get_value ( ) const
inline

Definition at line 198 of file data.hpp.

198{ return value; }

◆ last()

template<typename Tp >
value_type & tim::component::base_data< Tp, 2 >::last ( )
inline

Definition at line 292 of file data.hpp.

292{ return value; }

◆ load() [1/2]

template<typename Tp >
value_type & tim::component::base_data< Tp, 2 >::load ( bool  is_transient)
inline

Definition at line 220 of file data.hpp.

221 {
222 return (is_transient) ? accum : value;
223 }

◆ load() [2/2]

template<typename Tp >
const value_type & tim::component::base_data< Tp, 2 >::load ( bool  is_transient) const
inline

Definition at line 224 of file data.hpp.

225 {
226 return (is_transient) ? accum : value;
227 }

◆ minus() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 2 >::minus ( const value_type rhs)
inline

Definition at line 235 of file data.hpp.

236 {
239 }
static decltype(auto) minus(type &_l, const V &_r)
Definition: compute.hpp:99

References tim::math::compute< Tp, Up >::minus().

◆ minus() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 2 >::minus ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 262 of file data.hpp.

264 {
265 value =
266 math::compute<value_type>::minus(value, std::forward<Up>(rhs).get_value());
267 accum =
268 math::compute<value_type>::minus(accum, std::forward<Up>(rhs).get_accum());
269 }

References tim::math::compute< Tp, Up >::minus().

◆ multiply() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 2 >::multiply ( const value_type rhs)
inline

Definition at line 241 of file data.hpp.

242 {
245 }
static decltype(auto) multiply(type &_l, const V &_r)
Definition: compute.hpp:105

References tim::math::compute< Tp, Up >::multiply().

◆ multiply() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 2 >::multiply ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 272 of file data.hpp.

274 {
275 value =
276 math::compute<value_type>::multiply(value, std::forward<Up>(rhs).get_value());
277 accum =
278 math::compute<value_type>::multiply(accum, std::forward<Up>(rhs).get_accum());
279 }

References tim::math::compute< Tp, Up >::multiply().

◆ operator=() [1/2]

template<typename Tp >
base_data & tim::component::base_data< Tp, 2 >::operator= ( base_data< Tp, 2 > &&  )
default

◆ operator=() [2/2]

template<typename Tp >
base_data & tim::component::base_data< Tp, 2 >::operator= ( const base_data< Tp, 2 > &  rhs)
default

◆ plus() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 2 >::plus ( const value_type rhs)
inline

Definition at line 229 of file data.hpp.

230 {
233 }
static decltype(auto) plus(type &_l, const V &_r)
Definition: compute.hpp:93

References tim::math::compute< Tp, Up >::plus().

◆ plus() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 2 >::plus ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 254 of file data.hpp.

256 {
257 value = math::compute<value_type>::plus(value, std::forward<Up>(rhs).get_value());
258 accum = math::compute<value_type>::plus(accum, std::forward<Up>(rhs).get_accum());
259 }

References tim::math::compute< Tp, Up >::plus().

◆ reset()

template<typename Tp >
void tim::component::base_data< Tp, 2 >::reset ( )
inlineprotected

Definition at line 295 of file data.hpp.

296 {
297 value = Tp{};
298 accum = Tp{};
299 }

◆ serialize()

template<typename Tp >
template<typename ArchiveT >
void tim::component::base_data< Tp, 2 >::serialize ( ArchiveT &  ar,
const unsigned int  = 0 
)
inline

Definition at line 215 of file data.hpp.

216 {
217 ar(cereal::make_nvp("value", value), cereal::make_nvp("accum", accum));
218 }

◆ set_accum()

template<typename Tp >
void tim::component::base_data< Tp, 2 >::set_accum ( value_type  v)
inline

Definition at line 202 of file data.hpp.

202{ accum = v; }

◆ set_last()

template<typename Tp >
void tim::component::base_data< Tp, 2 >::set_last ( value_type  )
inline

Definition at line 203 of file data.hpp.

203{}

◆ set_value()

template<typename Tp >
void tim::component::base_data< Tp, 2 >::set_value ( value_type  v)
inline

Definition at line 201 of file data.hpp.

201{ value = v; }

Friends And Related Function Documentation

◆ base

template<typename Tp >
template<typename Up , typename ValueT >
friend struct base
friend

Definition at line 191 of file data.hpp.

Member Data Documentation

◆ accum

template<typename Tp >
value_type tim::component::base_data< Tp, 2 >::accum = Tp{}
protected

Definition at line 303 of file data.hpp.

◆ value

template<typename Tp >
value_type tim::component::base_data< Tp, 2 >::value = Tp{}
protected

Definition at line 302 of file data.hpp.


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