39#include "timemory/tpls/cereal/archives.hpp"
60template <
typename TraitT>
64 constexpr bool _val = TraitT::value;
65 return (_val) ?
"true" :
"false";
131template <
typename Tp>
143 static TIMEMORY_HOT TIMEMORY_INLINE
bool get() {
return get_runtime_value(); }
146 static void set(
bool val) { get_runtime_value() = val; }
149 static TIMEMORY_HOT TIMEMORY_INLINE
bool& get_runtime_value()
175 template <
typename U>
176 static constexpr bool get_value()
189 template <
typename U = T>
190 static TIMEMORY_INLINE
bool get(
198 template <
typename U = T>
199 static TIMEMORY_INLINE
bool set(
202 return (get_runtime_value() = val);
206 template <
typename U = T>
207 static TIMEMORY_INLINE
bool get(
214 template <
typename U = T>
215 static TIMEMORY_INLINE
bool set(
222 static TIMEMORY_HOT
bool& get_runtime_value()
224 static bool _instance =
330template <
typename T,
typename Tag>
519template <
typename Api>
531template <
typename Api>
536 static constexpr bool is_default_v = std::is_same<default_type, type_list<>>::value;
541 cereal::MinimalJSONOutputArchive>,
549template <
typename T,
typename Api>
559template <
typename T,
typename Api>
571 static constexpr bool is_json = (std::is_same<api_type, pretty_type>::value ||
572 std::is_same<api_type, minimal_type>::value);
581 using type = cereal::BaseJSONOutputArchive<cereal::PrettyJsonWriter>;
584template <
typename Api>
597 type_list<cereal::JSONInputArchive, cereal::PrettyJSONOutputArchive,
598 cereal::MinimalJSONOutputArchive>;
600 type_list<cereal::BinaryInputArchive, cereal::BinaryOutputArchive,
601 cereal::PortableBinaryInputArchive,
602 cereal::PortableBinaryOutputArchive>;
604 template <
typename U = T>
610 template <
typename U = T>
616 template <
typename U = T>
632#define TIMEMORY_REPORT_GET_SET(FNAME, FIELD) \
633 static bool FNAME() { return get(FIELD); } \
634 static void FNAME(bool val) { set(FIELD, val); }
636#define TIMEMORY_REPORT_ENV_QUERY(FIELD) \
637 get_env<bool>("TIMEMORY_PRINT_" #FIELD, get_runtime_value().at(FIELD))
658 static bool get(
short idx)
660 return get_runtime_value().at(idx %
FIELDS_END) &&
664 static void set(
short idx,
bool val)
666 get_runtime_value().at(idx %
FIELDS_END) = val;
708#undef TIMEMORY_REPORT_ENV_QUERY
709#undef TIMEMORY_REPORT_GET_SET
816 static constexpr size_t size = 0;
817 using type = std::tuple<type_list<>>;
846template <
int OpT,
typename T>
854template <
int OpT,
typename T>
878template <
typename T,
typename V>
889 static constexpr bool value =
false;
896 static constexpr bool value =
false;
903 using type =
typename T::value_type;
951template <
typename T,
typename V,
typename A>
970struct uses_value_storage<T,
type_list<>, false_type>
973 static constexpr bool value =
false;
976template <
typename T,
typename A>
980 static constexpr bool value =
false;
983template <
typename T,
typename A>
987 static constexpr bool value =
false;
991template <
typename T,
typename A>
998template <
typename ApiT>
1001 static constexpr auto value =
"timemory";
1009template <
typename T>
1018template <
typename T>
1027template <
typename T>
1038template <
typename T>
1048template <
typename T>
1060template <
typename T>
1071template <
typename T,
typename Tuple>
1085#if !defined(TIMEMORY_DEFINE_CONCRETE_TRAIT)
1086# define TIMEMORY_DEFINE_CONCRETE_TRAIT(TRAIT, COMPONENT, VALUE) \
1092 struct TRAIT<COMPONENT> : VALUE \
1100#if !defined(TIMEMORY_DEFINE_TEMPLATE_TRAIT)
1101# define TIMEMORY_DEFINE_TEMPLATE_TRAIT(TRAIT, COMPONENT, VALUE, TYPE) \
1107 struct TRAIT<COMPONENT<T>> : VALUE \
1115#if !defined(TIMEMORY_DEFINE_VARIADIC_TRAIT)
1116# define TIMEMORY_DEFINE_VARIADIC_TRAIT(TRAIT, COMPONENT, VALUE, TYPE) \
1121 template <TYPE... T> \
1122 struct TRAIT<COMPONENT<T...>> : VALUE \
#define TIMEMORY_INPUT_ARCHIVE
#define TIMEMORY_DEFAULT_ENABLED
#define TIMEMORY_OUTPUT_ARCHIVE
typename get_true_types< Predicate, Sequence... >::type get_true_types_t
typename component_value_type< T, is_available< T >::value >::type component_value_type_t
conditional_t<!std::is_same< type_list<>, typename data< T >::type >::value, typename data< T >::type, typename T::value_type > type
TIMEMORY_INPUT_ARCHIVE type
typename python_args< OpT, T >::type python_args_t
typename api_input_archive< Api >::type type
typename component_apis< T >::type component_apis_t
trait to specify the value type of a component before the definition of the component
trait that specifies the units
trait to specify the APIs that the component is logically a part of
trait that specifies the data type of the statistics
trait that specifies the intermediate data type that will hold the relevant data required by the comp...
trait that can be used to override the evaluation of the tim::trait::collects_data trait....
trait that designates the type supports these arguments from python. Specializations MUST be structur...
trait that designates components in an API (tim::api)
typename std::enable_if< B, T >::type enable_if_t
Alias template for enable_if.
tim::mpl::apply< std::string > string
typename std::conditional< B, Lhs, Rhs >::type conditional_t
lightweight tuple-alternative for meta-programming logic
concept that specifies that a type is not a useful type
this is a placeholder type for optional type-traits. It is used as the default type for the type-trai...
trait that configures the default output archive type for an entire API specification,...
TIMEMORY_OUTPUT_ARCHIVE default_type
static constexpr bool is_pretty_v
static constexpr bool is_default_v
conditional_t< is_default_v, conditional_t< is_pretty_v, cereal::PrettyJSONOutputArchive, cereal::MinimalJSONOutputArchive >, default_type > type
generic functions for setting/accessing static properties on types
Extension for the input or output archive types. It will throw an error if used on new archive types ...
enable_if_t< is_one_of< U, binary_types >::value, std::string > operator()()
enable_if_t< is_one_of< U, json_types >::value, std::string > operator()()
enable_if_t< is_one_of< U, xml_types >::value, std::string > operator()()
trait that signifies that data is an array type
trait that signifies that a component has an accumulation value. In general, most components implemen...
trait that signifies that a component has an "last" value which may be different than the "value" val...
trait that specifies or determines if a component collects any data. Default behavior is to check if ...
static constexpr bool value
component_value_type_t< T > type
trait that signifies that a component will handle printing the label(s)
trait that signifies the component will be providing it's own split load(...) and store(....
trait that signifies that a component will handle printing the units(s)
trait whose compile-time constant field value designates the default runtime value of tim::trait::run...
trait that designates the type supports calling assemble and derive member functions with these types...
std::tuple< type_list<> > type
static constexpr size_t size
trait that configures echo_measurement usage
trait that signifies the component samples a measurement from a file. If multiple components sample f...
trait that designates whether there is a priority when finalizing the type w.r.t. other types....
trait that configures type to always use flat call-stack storage
typename T::value_type type
trait used to evaluate whether a component value type produces a useable value
static constexpr bool value
trait that signifies that an implementation for the component is available. When this is set to false...
trait that designates the type is a timemory component
trait that designates the type is a gotcha
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 type is a user-bundle
trait that signifies that get() returns an iterable type
cereal::BaseJSONOutputArchive< cereal::PrettyJsonWriter > type
trait that configures output archive type
static constexpr bool is_pretty_v
static constexpr bool is_json
cereal::MinimalJSONOutputArchive minimal_type
cereal::PrettyJSONOutputArchive pretty_type
conditional_t< is_json, conditional_t< is_pretty_v, pretty_type, api_type >, api_type > type
typename api_output_archive< Api >::type api_type
Provides the static category for perfetto traces.
static constexpr auto value
trait that will suppress compilation error in operation::add_statistics<Component> if the data type p...
trait that configures whether output archive uses pretty formmatting. If set to false_type then the J...
trait that signifies that updating w.r.t. another instance should be a max of the two instances
trait that signifies the component will calculate min/max/stddev
trait that configures type to not report the number of lap count (useful if meaningless)....
trait that configures type to not report the mean value (useful if meaningless). Only applies to text...
trait that configures type to not report the "METRIC" column, useful if redundant)....
trait that configures type to not report the % self field (useful if meaningless)....
trait that configures type to not report the "UNITS" column (useful if always empty)....
trait that configures type to not report the accumulated value (useful if meaningless)....
trait that configures type to not report the "UNITS" column (useful if always empty)....
trait that allows runtime configuration of reporting certain types of values. Only applies to text ou...
std::array< bool, FIELDS_END > value_type
static bool get(short idx)
static void set(short idx, bool val)
trait that designates a type should always print a JSON output
trait that signifies that a component requires the prefix to be set right after construction....
static void set(bool val)
trait that signifies that an implementation is enabled at runtime. The value returned from get() is f...
static bool get(enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
GET specialization if component is available.
mpl::get_true_types_t< concepts::is_runtime_configurable, component_apis_t< T > > api_type_list
type-list of APIs that are runtime configurable
static bool set(bool val, enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
SET specialization if component is available.
static constexpr bool value
static bool get(enable_if_t<!is_available< U >::value||!get_value< U >(), long >=0)
GET specialization if component is NOT available.
static bool set(bool, enable_if_t<!is_available< U >::value||!get_value< U >(), long >=0)
SET specialization if component is NOT available.
trait that signifies the component supports sampling.
trait that signifies that secondary data resembling the original data exists but should be another no...
trait that designates whether there is a priority when starting the type w.r.t. other types....
trait that designates whether there is a priority when stopping the type w.r.t. other types....
trait that designates the type supports calling a function with a certain set of argument types (pass...
trait that designates the type supports changing the record() static function per-instance
trait that designates a type supports flamegraph output
trait to specify that the type supports toggling availablity at runtime. Supporting runtime availabil...
trait that signifies the component only has relevant values if it is not collapsed into the master th...
trait that configures type to always use timeline call-stack storage
trait that configures type to always use hierarchical call-stack storage
trait that designates the units should follow unit settings related to memory measurements
trait that designates the units are a percentage
trait that designates that a component will instantiate tim::storage
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.
static constexpr bool avail_v
static constexpr bool output_v
static constexpr bool value
#define TIMEMORY_REPORT_GET_SET(FNAME, FIELD)
#define TIMEMORY_REPORT_ENV_QUERY(FIELD)