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, 3 > Struct Template Reference

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

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

Public Types

using value_type = Tp
 
using accum_type = Tp
 
using last_type = Tp
 

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 v)
 
 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())
 

Protected Member Functions

void reset ()
 

Protected Attributes

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

Friends

template<typename Up , typename ValueT >
struct base
 

Detailed Description

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

Definition at line 307 of file data.hpp.

Member Typedef Documentation

◆ accum_type

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

Definition at line 313 of file data.hpp.

◆ last_type

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

Definition at line 314 of file data.hpp.

◆ value_type

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

Definition at line 312 of file data.hpp.

Constructor & Destructor Documentation

◆ base_data() [1/3]

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

◆ ~base_data()

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

◆ base_data() [2/3]

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

◆ base_data() [3/3]

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

Member Function Documentation

◆ divide() [1/2]

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

Definition at line 366 of file data.hpp.

367 {
370 }
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, 3 >::divide ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 401 of file data.hpp.

403 {
404 value =
405 math::compute<value_type>::divide(value, std::forward<Up>(rhs).get_value());
406 accum =
407 math::compute<value_type>::divide(accum, std::forward<Up>(rhs).get_accum());
408 }
const value_type & get_value() const
Definition: data.hpp:316
const value_type & get_accum() const
Definition: data.hpp:317

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

◆ get_accum()

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

Definition at line 317 of file data.hpp.

317{ return accum; }

◆ get_last()

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

Definition at line 318 of file data.hpp.

318{ return last; }

◆ get_value()

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

Definition at line 316 of file data.hpp.

316{ return value; }

◆ load() [1/2]

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

Definition at line 339 of file data.hpp.

340 {
341 return (is_transient) ? accum : value;
342 }

◆ load() [2/2]

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

Definition at line 343 of file data.hpp.

344 {
345 return (is_transient) ? accum : value;
346 }

◆ minus() [1/2]

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

Definition at line 354 of file data.hpp.

355 {
358 }
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, 3 >::minus ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 381 of file data.hpp.

383 {
384 value =
385 math::compute<value_type>::minus(value, std::forward<Up>(rhs).get_value());
386 accum =
387 math::compute<value_type>::minus(accum, std::forward<Up>(rhs).get_accum());
388 }

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

◆ multiply() [1/2]

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

Definition at line 360 of file data.hpp.

361 {
364 }
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, 3 >::multiply ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 391 of file data.hpp.

393 {
394 value =
395 math::compute<value_type>::multiply(value, std::forward<Up>(rhs).get_value());
396 accum =
397 math::compute<value_type>::multiply(accum, std::forward<Up>(rhs).get_accum());
398 }

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ plus() [1/2]

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

Definition at line 348 of file data.hpp.

349 {
352 }
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, 3 >::plus ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), (void) std::forward<Up>(rhs).get_accum(), void())
inline

Definition at line 373 of file data.hpp.

375 {
376 value = math::compute<value_type>::plus(value, std::forward<Up>(rhs).get_value());
377 accum = math::compute<value_type>::plus(accum, std::forward<Up>(rhs).get_accum());
378 }

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

◆ reset()

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

Definition at line 411 of file data.hpp.

412 {
413 value = Tp{};
414 accum = Tp{};
415 last = Tp{};
416 }

◆ serialize()

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

Definition at line 333 of file data.hpp.

334 {
335 ar(cereal::make_nvp("value", value), cereal::make_nvp("accum", accum),
336 cereal::make_nvp("last", last));
337 }

◆ set_accum()

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

Definition at line 320 of file data.hpp.

320{ accum = v; }

◆ set_last()

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

Definition at line 321 of file data.hpp.

321{ last = v; }

◆ set_value()

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

Definition at line 319 of file data.hpp.

319{ value = v; }

Friends And Related Function Documentation

◆ base

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

Definition at line 310 of file data.hpp.

Member Data Documentation

◆ accum

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

Definition at line 420 of file data.hpp.

◆ last

template<typename Tp >
value_type tim::component::base_data< Tp, 3 >::last = Tp{}
protected

Definition at line 421 of file data.hpp.

◆ value

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

Definition at line 419 of file data.hpp.


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