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::operation::init_storage< Tp > Struct Template Reference

#include "timemory/operations/declaration.hpp"

+ Collaboration diagram for tim::operation::init_storage< Tp >:

Public Types

using type = Tp
 
using string_t = std::string
 
using this_type = init_storage< Tp >
 
using pointer_t = tim::base::storage *
 
using get_type = std::tuple< pointer_t, bool, bool, bool >
 

Public Member Functions

template<typename Up = Tp>
 init_storage (enable_if_t< trait::uses_value_storage< Up >::value, int >=0)
 
template<typename Up = Tp>
 init_storage (enable_if_t<!trait::uses_value_storage< Up >::value, int >=0)
 
template<typename U , typename V >
init_storage< Tp >::get_type get (enable_if_t< !trait::uses_value_storage< U, V >::value &&!std::is_same< typename U::storage_type, component::empty_storage >::value, int >)
 
template<typename U , typename V >
init_storage< Tp >::get_type get (enable_if_t< !trait::uses_value_storage< U, V >::value &&std::is_same< typename U::storage_type, component::empty_storage >::value, int >)
 

Static Public Member Functions

template<typename U = Tp, typename V = typename U::value_type>
static get_type get (enable_if_t< trait::uses_value_storage< U, V >::value, int >=0)
 
template<typename U = Tp, typename V = typename U::value_type>
static get_type get (enable_if_t<!trait::uses_value_storage< U, V >::value &&!std::is_same< typename U::storage_type, component::empty_storage >::value, int >=0)
 
template<typename U = Tp, typename V = typename U::value_type>
static get_type get (enable_if_t<!trait::uses_value_storage< U, V >::value &&std::is_same< typename U::storage_type, component::empty_storage >::value, int >=0)
 
static void init ()
 

Detailed Description

template<typename Tp>
struct tim::operation::init_storage< Tp >

Definition at line 587 of file declaration.hpp.

Member Typedef Documentation

◆ get_type

template<typename Tp >
using tim::operation::init_storage< Tp >::get_type = std::tuple<pointer_t, bool, bool, bool>

Definition at line 593 of file declaration.hpp.

◆ pointer_t

Definition at line 592 of file declaration.hpp.

◆ string_t

template<typename Tp >
using tim::operation::init_storage< Tp >::string_t = std::string

Definition at line 590 of file declaration.hpp.

◆ this_type

template<typename Tp >
using tim::operation::init_storage< Tp >::this_type = init_storage<Tp>

Definition at line 591 of file declaration.hpp.

◆ type

template<typename Tp >
using tim::operation::init_storage< Tp >::type = Tp

Definition at line 589 of file declaration.hpp.

Constructor & Destructor Documentation

◆ init_storage() [1/2]

template<typename Tp >
template<typename Up >
tim::operation::init_storage< Tp >::init_storage ( enable_if_t< trait::uses_value_storage< Up >::value, int >  = 0)

Definition at line 46 of file init_storage.hpp.

47{
48#if defined(TIMEMORY_DISABLE_COMPONENT_STORAGE_INIT)
49#else
50 using value_type = typename type::value_type;
51 base::storage::template base_instance<type, value_type>();
52#endif
53}

◆ init_storage() [2/2]

template<typename Tp >
template<typename Up = Tp>
tim::operation::init_storage< Tp >::init_storage ( enable_if_t<!trait::uses_value_storage< Up >::value, int >  = 0)
inline

Definition at line 599 of file declaration.hpp.

600 {}

Member Function Documentation

◆ get() [1/5]

template<typename Tp >
template<typename U , typename V >
init_storage< Tp >::get_type tim::operation::init_storage< Tp >::get ( enable_if_t< !trait::uses_value_storage< U, V >::value &&!std::is_same< typename U::storage_type, component::empty_storage >::value, int >  )

Definition at line 85 of file init_storage.hpp.

90{
91#if defined(TIMEMORY_DISABLE_COMPONENT_STORAGE_INIT)
92 return get_type{ nullptr, false, false, false };
93#else
94 static thread_local auto _instance = []() {
96 return get_type{ nullptr, false, false, false };
97
98 using value_type = typename type::value_type;
99 auto this_inst = tim::base::storage::template base_instance<Tp, value_type>();
100 this_inst->initialize();
101 return get_type{ this_inst, false, false, false };
102 }();
103 return _instance;
104#endif
105}
std::tuple< pointer_t, bool, bool, bool > get_type
static bool get(enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
GET specialization if component is available.

◆ get() [2/5]

template<typename Tp >
template<typename U , typename V >
init_storage< Tp >::get_type tim::operation::init_storage< Tp >::get ( enable_if_t< !trait::uses_value_storage< U, V >::value &&std::is_same< typename U::storage_type, component::empty_storage >::value, int >  )

Definition at line 111 of file init_storage.hpp.

116{
117 return get_type{ nullptr, false, false, false };
118}

◆ get() [3/5]

template<typename Tp >
template<typename U , typename V >
init_storage< Tp >::get_type tim::operation::init_storage< Tp >::get ( enable_if_t< trait::uses_value_storage< U, V >::value, int >  = 0)
static

Definition at line 59 of file init_storage.hpp.

61{
62#if defined(TIMEMORY_DISABLE_COMPONENT_STORAGE_INIT)
63 return get_type{ nullptr, false, false, false };
64#else
65 static thread_local auto _instance = []() {
67 return get_type{ nullptr, false, false, false };
68
69 using value_type = typename type::value_type;
70 auto this_inst = tim::base::storage::template base_instance<Tp, value_type>();
71 this_inst->initialize();
72 bool this_glob = true;
73 bool this_work = true;
74 bool this_data = this_inst->data_init();
75 return get_type{ this_inst, this_glob, this_work, this_data };
76 }();
77 return _instance;
78#endif
79}

◆ get() [4/5]

template<typename Tp >
template<typename U = Tp, typename V = typename U::value_type>
static get_type tim::operation::init_storage< Tp >::get ( enable_if_t<!trait::uses_value_storage< U, V >::value &&!std::is_same< typename U::storage_type, component::empty_storage >::value, int >  = 0)
static

◆ get() [5/5]

template<typename Tp >
template<typename U = Tp, typename V = typename U::value_type>
static get_type tim::operation::init_storage< Tp >::get ( enable_if_t<!trait::uses_value_storage< U, V >::value &&std::is_same< typename U::storage_type, component::empty_storage >::value, int >  = 0)
static

◆ init()

template<typename Tp >
void tim::operation::init_storage< Tp >::init
static

Definition at line 124 of file init_storage.hpp.

125{
127 return;
128
129#if defined(TIMEMORY_DISABLE_COMPONENT_STORAGE_INIT)
130#else
131 static thread_local auto _init = this_type::get();
132 consume_parameters(_init);
133#endif
134}
void consume_parameters(ArgsT &&...)
Definition: types.hpp:285
static get_type get(enable_if_t< trait::uses_value_storage< U, V >::value, int >=0)

References tim::consume_parameters(), and tim::get().

Referenced by tim::operation::push_node< Tp >::operator()().


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