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::storage_initializer Struct Reference

This provides an object that can initialize the storage opaquely, e.g. More...

#include "timemory/operations/declaration.hpp"

+ Collaboration diagram for tim::storage_initializer:

Static Public Member Functions

template<typename T >
static enable_if_t< trait::uses_storage< T >::value, storage_initializerget (std::true_type)
 
template<typename T >
static enable_if_t<!trait::uses_storage< T >::value, storage_initializerget (std::false_type)
 
template<typename T >
static storage_initializer get ()
 
template<size_t Idx, enable_if_t< Idx !=TIMEMORY_COMPONENTS_END > = 0>
static storage_initializer get ()
 
template<size_t Idx, enable_if_t< Idx==TIMEMORY_COMPONENTS_END > = 0>
static auto get ()
 
template<typename... Tp, enable_if_t< sizeof...(Tp) !=1 > = 0>
static auto get ()
 
template<size_t... Idx, enable_if_t< sizeof...(Idx) !=1 > = 0>
static auto get ()
 
template<size_t... Idx>
static auto get (std::index_sequence< Idx... >)
 

Detailed Description

This provides an object that can initialize the storage opaquely, e.g.

This operation class is used for generic storage initalization.

namespace
{
tim::storage_initializer storage = tim::storage_initalizer::get<T>();
}
This provides an object that can initialize the storage opaquely, e.g.
Definition: declaration.hpp:98

Definition at line 97 of file declaration.hpp.

Member Function Documentation

◆ get() [1/8]

template<typename T >
storage_initializer tim::storage_initializer::get
static

Definition at line 132 of file declaration.hpp.

133{
134 return get<T>(trait::is_available_t<T>{});
135}

Referenced by get().

◆ get() [2/8]

template<size_t Idx, enable_if_t< Idx !=TIMEMORY_COMPONENTS_END > >
storage_initializer tim::storage_initializer::get
static

Definition at line 100 of file storage_initializer.hpp.

101{
102 return storage_initializer::get<component::enumerator_t<Idx>>();
103}

◆ get() [3/8]

template<size_t... Idx, enable_if_t< sizeof...(Idx) !=1 > >
auto tim::storage_initializer::get
static

Definition at line 141 of file declaration.hpp.

142{
143 return get(std::make_index_sequence<Idx>{});
144}
static storage_initializer get()

References get().

◆ get() [4/8]

template<typename... Tp, enable_if_t< sizeof...(Tp) !=1 > = 0>
static auto tim::storage_initializer::get ( )
static

◆ get() [5/8]

template<size_t... Idx, enable_if_t< sizeof...(Idx) !=1 > = 0>
static auto tim::storage_initializer::get ( )
static

◆ get() [6/8]

template<typename T >
enable_if_t<!trait::uses_storage< T >::value, storage_initializer > tim::storage_initializer::get ( std::false_type  )
static

Definition at line 90 of file storage_initializer.hpp.

92{
93 return storage_initializer{};
94}

◆ get() [7/8]

template<size_t... Idx>
auto tim::storage_initializer::get ( std::index_sequence< Idx... >  )
static

Definition at line 167 of file declaration.hpp.

168{
169 return TIMEMORY_RETURN_FOLD_EXPRESSION(storage_initializer::get<Idx>());
170}
#define TIMEMORY_RETURN_FOLD_EXPRESSION(...)
Definition: types.hpp:71

References TIMEMORY_RETURN_FOLD_EXPRESSION.

◆ get() [8/8]

template<typename T >
enable_if_t< trait::uses_storage< T >::value, storage_initializer > tim::storage_initializer::get ( std::true_type  )
static

Definition at line 66 of file storage_initializer.hpp.

68{
69 auto library_ctor = tim::get_env<bool>("TIMEMORY_LIBRARY_CTOR", true);
70 if(!library_ctor)
71 return storage_initializer{};
72
74 return storage_initializer{};
75
76 invoke_preinit<T>(0);
77
78 using storage_type = storage<T, typename T::value_type>;
79
80 static auto _master = (storage_type::master_instance(), storage_initializer{});
81 static thread_local auto _worker = (storage_type::instance(), storage_initializer{});
82 consume_parameters(_master);
83
84 return _worker;
85}
void consume_parameters(ArgsT &&...)
Definition: types.hpp:285
static bool get(enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
GET specialization if component is available.

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