34 #include "timemory/tpls/cereal/cereal.hpp"
41 template <
typename Tp>
44 template <
typename Tp>
66 template <
typename Tp,
typename Value>
129 template <
typename Ret,
typename Lhs,
typename Rhs>
132 static_assert(std::is_pointer<Tp>::value ==
false,
"Error pointer base type");
135 TIMEMORY_DEFAULT_OBJECT(
base)
138 template <
typename... Args>
156 void get(
void*& ptr,
size_t _typeid_hash)
const;
159 TIMEMORY_NODISCARD
auto get()
const {
return this->
load(); }
175 template <
typename Up = Tp>
179 template <
typename Up = Tp>
190 template <
typename Archive,
typename Up =
Type,
192 void load(Archive& ar,
unsigned int);
195 template <
typename Archive,
typename Up =
Type,
197 void save(Archive& ar,
unsigned int version)
const;
199 template <
typename Vp,
typename Up = Tp,
204 TIMEMORY_NODISCARD TIMEMORY_INLINE int64_t
get_laps()
const {
return laps; }
215 using data_type::get_accum;
216 using data_type::get_last;
217 using data_type::get_value;
225 using data_type::set_accum;
226 using data_type::set_last;
227 using data_type::set_value;
230 TIMEMORY_NODISCARD decltype(
auto)
load()
const
251 if(rhs.get_is_transient())
258 if(rhs.get_is_transient())
270 using data_type::accum;
271 using data_type::last;
272 using data_type::value;
285 #if !defined(DOXYGEN_SHOULD_SKIP_THIS)
290 template <typename Up = Type, typename UnitT = typename trait::units<Up>::type,
294 template <
typename Up =
Type,
299 template <typename Up = Type, typename UnitT = typename trait::units<Up>::type,
303 template <
typename Up =
Type,
324 template <
typename Tp>
325 struct base<Tp, void>
330 using EmptyT = std::tuple<>;
370 template <
typename Ret,
typename Lhs,
typename Rhs>
374 TIMEMORY_DEFAULT_OBJECT(
base)
377 template <
typename... Args>
388 TIMEMORY_NODISCARD TIMEMORY_INLINE int64_t
get_laps()
const {
return 0; }
389 TIMEMORY_NODISCARD TIMEMORY_INLINE
void*
get_iterator()
const {
return nullptr; }
391 TIMEMORY_INLINE
void set_laps(int64_t) {}
396 TIMEMORY_INLINE
void get() {}
397 TIMEMORY_INLINE
void get(
void*& ptr,
size_t _typeid_hash)
const;
422 if(rhs.get_is_transient())
428 if(rhs.get_is_transient())
Arbitrary Graph / Tree (i.e. binary-tree but not binary). It is unlikely that this class will interac...
Declare the base component types.
void load(Archive &ar, tim::node::graph< Tp > &d)
typename internal::base_data< Tp, ValueT >::type base_data_t
typename graph< node::graph< Tp > >::const_iterator graph_const_iterator_t
typename graph< node::graph< Tp > >::iterator graph_iterator_t
typename std::enable_if< B, T >::type enable_if_t
a generic type for prioritizing a function call to the base class over derived functions,...
This operation class is used for copying the object generically.
tim::mpl::apply< std::string > string
Declare the operations types.
Declare the storage types.
Provide state configuration options for a component instance. The current states are:
void set_is_transient(bool v)
void set_is_on_stack(bool v)
bool get_depth_change() const
void set_is_running(bool v)
bool get_is_on_stack() const
bool get_is_transient() const
void set_depth_change(bool v)
bool get_is_running() const
bool get_is_invalid() const
void set_is_invalid(bool v)
Type & operator-=(const Type &rhs)
static short get_precision()
Type & operator/=(const Value &rhs)
void set_is_transient(bool v)
Type & minus_oper(const Type &rhs)
base_data_t< Tp, Value > data_type
auto get_iterator() const
static base_storage_type * get_storage()
Type & operator*=(const Type &rhs)
void reset()
reset the values
Type & minus_oper(const Value &rhs)
graph_iterator_t< Tp > graph_iterator
auto get_display() const
retrieve the current measurement value in the units for the type in a format that can be piped to the...
static constexpr bool memory_category_v
static int64_t get_unit()
Type & operator*=(const Value &rhs)
void save(Archive &ar, unsigned int version) const
serialization store (output)
static constexpr auto ios_showpoint
friend std::ostream & operator<<(std::ostream &os, const base_type &obj)
void print(std::ostream &, enable_if_t<!trait::uses_value_storage< Up, Value >::value, long >=0) const
static constexpr bool timing_category_v
static std::string get_label()
void set_iterator(graph_iterator itr)
base< Tp, Value > base_type
int64_t get_laps() const
add a sample
Type & multiply_oper(const Value &rhs)
Type & multiply_oper(const Type &rhs)
auto plus(crtp::base, const base_type &rhs)
Type & plus_oper(const Type &rhs)
Type & operator+=(const Value &rhs)
auto minus(crtp::base, const base_type &rhs)
void set_stopped()
store that stop has been called
bool get_is_transient() const
static std::string display_unit()
Type & operator+=(const Type &rhs)
static std::string get_display_unit()
Type & operator/=(const Type &rhs)
static const fmtflags format_flags
typename data_type::accum_type accum_type
Type & divide_oper(const Value &rhs)
static constexpr auto ios_fixed
void load(Archive &ar, unsigned int)
serialization load (input)
Type & plus_oper(const Value &rhs)
static void add_sample(Vp &&)
typename data_type::last_type last_type
static void configure(Args &&...)
static fmtflags get_format_flags()
static opaque get_opaque(scope::config)
get the opaque binding for user-bundle
static std::string label()
void print(std::ostream &, enable_if_t< trait::uses_value_storage< Up, Value >::value, int >=0) const
storage< Tp, Value > storage_type
static constexpr bool timing_units_v
Type & divide_oper(const Type &rhs)
void minus(const base_type &rhs)
static constexpr bool percent_units_v
static constexpr bool memory_units_v
static constexpr bool is_component
auto get() const
retrieve the current measurement value in the units for the type
std::vector< U > vector_t
Type & operator-=(const Value &rhs)
void get(void *&ptr, size_t _typeid_hash) const
assign type to a pointer
void plus(const base_type &rhs)
void set_started()
store that start has been called
static std::string get_description()
static std::string description()
typename trait::dynamic_base< Tp >::type dynamic_type
typename trait::cache< Tp >::type cache_type
static constexpr auto ios_decimal
std::ios_base::fmtflags fmtflags
The default base class for timemory components.
This is the compact representation of a measurement in the call-graph.
this is a placeholder type for optional type-traits. It is used as the default type for the type-trai...
invoked from the base class to provide default printing behavior
The purpose of this operation class is operating on two components to compose a result,...
The purpose of this operation class is construct an object with specific args.
This operation class is used for division of a component.
This operation class is used for a single measurement for a component.
Define subtraction operations.
This operation class is used for multiplication of a component.
Define addition operations.
Print the storage for a component.
print routines for individual components
This operation class is used for sampling.
Call the set_prefix member function. These instantiations are always inlined because of the use of st...
This operation attempts to call a member function which the component provides to internally store wh...
This operation attempts to call a member function which the component provides to internally store wh...
Specification of how to accumulate statistics. This will not be used unless tim::trait::statistics ha...
this data type encodes the options of storage scope. The default is hierarchical (tree) scope....
trait that designates the type the static polymorphic base class (tim::component::base) inherit from.
trait that designates the width and precision should follow formatting settings related to memory mea...
trait that designates the width and precision should follow formatting settings related to timing mea...
trait that designates the units should follow unit settings related to memory measurements
trait that designates the units are a percentage
trait that designates the units should follow unit settings related to timing measurements
This trait is used to determine whether the (expensive) instantiation of the storage class happens.