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::trait Namespace Reference

Classes

struct  api_components
 trait that designates components in an API (tim::api) More...
 
struct  api_input_archive
 trait that configures the default input archive type for an entire API specification, e.g. TIMEMORY_API (which is struct tim::project::timemory). The input archive format of individual components is determined from the derived tim::trait::input_archive More...
 
struct  api_output_archive
 trait that configures the default output archive type for an entire API specification, e.g. TIMEMORY_API (which is struct tim::project::timemory). The output archive format of individual components is determined from the derived tim::trait::output_archive More...
 
struct  apply
 generic functions for setting/accessing static properties on types More...
 
struct  archive_extension
 Extension for the input or output archive types. It will throw an error if used on new archive types and not specialized. More...
 
struct  array_serialization
 trait that signifies that data is an array type More...
 
struct  base_has_accum
 trait that signifies that a component has an accumulation value. In general, most components implement 'value' and 'accum' data members of 'value_type'. Where 'value' is generally used as intermediate storage between start/stop and after stop have been called, 'value' is assigned as the difference between start/stop and added to 'accum'. However, in the case where 'accum' is not a valid metric for the component, this trait can be used to save memory bc it results in the 'accum' data member to be implemented as a data-type of std::tuple<>, which only requires 1 byte of memory. More...
 
struct  base_has_last
 trait that signifies that a component has an "last" value which may be different than the "value" value. In general, most components implement 'value' and 'accum' data members of 'value_type'. Where 'value' is generally used as intermediate storage between start/stop and after stop have been called, 'value' is assigned as the difference between start/stop and added to 'accum'. However, in the case where 'value' is valid as an individual measurement, this trait can be used to store 'value' as the individual measurement and 'last' as the difference or vice-versa. More...
 
struct  cache
 trait that specifies the intermediate data type that will hold the relevant data required by the component. This is useful for when multiple components read different parts of the same file (e.g. /proc/<PID>/io) or an API reports data in a larger data structure than the scope of the component (e.g. rusage) but multiple components require access to this data structure More...
 
struct  collects_data
 trait that specifies or determines if a component collects any data. Default behavior is to check if the component is available and extract the type and value fields from tim::trait::component_value_type. When a component is available, the 'type' of this trait will return the 'value type' for a component regardless of whether it was specified within the component definition or if it was declared via a type-trait. The constexpr 'value' boolean indicates whether the 'type' is not a null type. More...
 
struct  component_apis
 trait to specify the APIs that the component is logically a part of More...
 
struct  component_apis< component::data_tracker< InpT, Tag > >
 
struct  component_apis< component::gotcha< Nt, ComponentsT, DiffT > >
 
struct  component_value_type
 trait that can be used to override the evaluation of the tim::trait::collects_data trait. It checks to see if tim::trait::data is specialized and, if not, evaluates to: More...
 
struct  component_value_type< T, false >
 
struct  component_value_type< T, true >
 
struct  custom_label_printing
 trait that signifies that a component will handle printing the label(s) More...
 
struct  custom_serialization
 trait that signifies the component will be providing it's own split load(...) and store(...) for serialization so do not provide one in the base class More...
 
struct  custom_unit_printing
 trait that signifies that a component will handle printing the units(s) More...
 
struct  data
 trait to specify the value type of a component before the definition of the component More...
 
struct  default_runtime_enabled
 trait whose compile-time constant field value designates the default runtime value of tim::trait::runtime_enabled. Standard setting is true. More...
 
struct  derivation_types
 trait that designates the type supports calling assemble and derive member functions with these types. Specializations MUST be structured as a tim::type_list<...> of tim::type_list<...> where each inner type_list entry is the list of component types required to perform a derivation. More...
 
struct  derivation_types< component::printer >
 
struct  dynamic_base
 trait that designates the type the static polymorphic base class (tim::component::base) inherit from. More...
 
struct  echo_enabled
 trait that configures echo_measurement usage More...
 
struct  file_sampler
 trait that signifies the component samples a measurement from a file. If multiple components sample from the same file, it is recommended to create a cache type which performs a single read of the file and caches the values such that when these components are bundled together, they can just read their data from the cache structure. More...
 
struct  fini_priority
 trait that designates whether there is a priority when finalizing the type w.r.t. other types. Recommended for component which hold instances of other components. Lower values indicate higher priority. More...
 
struct  flat_storage
 trait that configures type to always use flat call-stack storage More...
 
struct  generates_output
 trait used to evaluate whether a component value type produces a useable value More...
 
struct  generates_output< T, data< T > >
 
struct  generates_output< T, null_type >
 
struct  generates_output< T, type_list<> >
 
struct  generates_output< T, void >
 
struct  input_archive
 trait that configures output archive type More...
 
struct  is_available
 trait that signifies that an implementation for the component is available. When this is set to false, the variadic component bundlers like component_tuple will silently filter out this type from the template parameters, e.g. More...
 
struct  is_available< component::placeholder< Types... > >
 
struct  is_available< T * >
 
struct  is_component
 trait that designates the type is a timemory component More...
 
struct  is_component< sampling::sampler< CompT, N > >
 
struct  is_gotcha
 trait that designates the type is a gotcha More...
 
struct  is_memory_category
 trait that designates the width and precision should follow formatting settings related to memory measurements More...
 
struct  is_timing_category
 trait that designates the width and precision should follow formatting settings related to timing measurements More...
 
struct  is_user_bundle
 trait that designates the type is a user-bundle More...
 
struct  iterable_measurement
 trait that signifies that get() returns an iterable type More...
 
struct  ompt_handle
 
struct  output_archive
 trait that configures output archive type More...
 
struct  output_archive< manager, Api >
 
struct  output_archive< manager, TIMEMORY_API >
 
struct  perfetto_category
 Provides the static category for perfetto traces. More...
 
struct  permissive_statistics
 trait that will suppress compilation error in operation::add_statistics<Component> if the data type passed is implicitly convertible to the data type in statistics<Component>::type but avoids converting integers to floating points and vice-versa. More...
 
struct  pretty_archive
 trait that configures whether output archive uses pretty formmatting. If set to false_type then the JSON/XML/etc. will be compact (if supported) More...
 
struct  python_args
 trait that designates the type supports these arguments from python. Specializations MUST be structured as either one tim::type_list<...> or a tim::type_list<...> of tim::type_list<...>. The first argument is a TIMEMORY_OPERATION enumerated type and for each inner tim::type_list, a python member function for the stand-alone component will be generated with those arguments. E.g. to create a custom store member function accepting integer: More...
 
struct  python_args< TIMEMORY_MARK_BEGIN, component::caliper_loop_marker >
 
struct  python_args< TIMEMORY_MARK_END, component::caliper_loop_marker >
 
struct  python_args< TIMEMORY_RECORD, component::caliper_loop_marker >
 
struct  record_max
 trait that signifies that updating w.r.t. another instance should be a max of the two instances More...
 
struct  record_statistics
 trait that signifies the component will calculate min/max/stddev More...
 
struct  report
 trait that allows runtime configuration of reporting certain types of values. Only applies to text output. This will allows modifying the value set by the specific "report_*" type-trait. More...
 
struct  report_count
 trait that configures type to not report the number of lap count (useful if meaningless). Only applies to text output. More...
 
struct  report_depth
 
struct  report_mean
 trait that configures type to not report the mean value (useful if meaningless). Only applies to text output. More...
 
struct  report_metric_name
 trait that configures type to not report the "METRIC" column, useful if redundant). Only applies to text output. More...
 
struct  report_self
 trait that configures type to not report the % self field (useful if meaningless). Only applies to text output. More...
 
struct  report_statistics
 trait that configures type to not report the "UNITS" column (useful if always empty). Only applies to text output and does NOT affect whether statistics are accumulated. For disabling statistics completely, see tim::trait::record_statistics and tim::policy::record_statistics. More...
 
struct  report_sum
 trait that configures type to not report the accumulated value (useful if meaningless). Only applies to text output. More...
 
struct  report_units
 trait that configures type to not report the "UNITS" column (useful if always empty). Only applies to text output. More...
 
struct  requires_json
 trait that designates a type should always print a JSON output More...
 
struct  requires_prefix
 trait that signifies that a component requires the prefix to be set right after construction. Types with this trait must contain a member string variable named prefix More...
 
struct  runtime_enabled
 trait that signifies that an implementation is enabled at runtime. The value returned from get() is for the specific setting for the type, the global settings (type: void) and the specific settings for it's APIs More...
 
struct  runtime_enabled< void >
 
struct  sampler
 trait that signifies the component supports sampling. More...
 
struct  secondary_data
 trait that signifies that secondary data resembling the original data exists but should be another node entry in the graph. These types must provide a get_secondary() member function and that member function must return a pair-wise iterable container, e.g. std::map, of types: More...
 
struct  start_priority
 trait that designates whether there is a priority when starting the type w.r.t. other types. Lower values indicate higher priority. More...
 
struct  statistics
 trait that specifies the data type of the statistics More...
 
struct  stop_priority
 trait that designates whether there is a priority when stopping the type w.r.t. other types. Lower values indicate higher priority. More...
 
struct  supports_args
 trait that designates the type supports calling a function with a certain set of argument types (passed via a tuple). More...
 
struct  supports_custom_record
 trait that designates the type supports changing the record() static function per-instance More...
 
struct  supports_flamegraph
 trait that designates a type supports flamegraph output More...
 
struct  supports_runtime_enabled
 trait to specify that the type supports toggling availablity at runtime. Supporting runtime availability has a relatively miniscule overhead but disabling it can ensure that the implementation truly maps down to the same assembly as hand-implementations. More...
 
struct  thread_scope_only
 trait that signifies the component only has relevant values if it is not collapsed into the master thread More...
 
struct  timeline_storage
 trait that configures type to always use timeline call-stack storage More...
 
struct  tree_storage
 trait that configures type to always use hierarchical call-stack storage More...
 
struct  units
 trait that specifies the units More...
 
struct  uses_memory_units
 trait that designates the units should follow unit settings related to memory measurements More...
 
struct  uses_percent_units
 trait that designates the units are a percentage More...
 
struct  uses_storage
 trait that designates that a component will instantiate tim::storage More...
 
struct  uses_timing_units
 trait that designates the units should follow unit settings related to timing measurements More...
 
struct  uses_value_storage
 This trait is used to determine whether the (expensive) instantiation of the storage class happens. More...
 
struct  uses_value_storage< T, null_type, A >
 
struct  uses_value_storage< T, type_list<>, A >
 
struct  uses_value_storage< T, void, A >
 

Typedefs

template<typename Tp >
using data_t = typename data< Tp >::type
 
template<typename T >
using component_apis_t = typename component_apis< T >::type
 
template<typename T >
using component_value_type_t = typename component_value_type< T, is_available< T >::value >::type
 
template<int OpT, typename T >
using python_args_t = typename python_args< OpT, T >::type
 
template<typename T >
using runtime_configurable = concepts::is_runtime_configurable< T >
 
template<typename T >
using input_archive_t = typename input_archive< T, TIMEMORY_API >::type
 
template<typename T >
using output_archive_t = typename output_archive< T, TIMEMORY_API >::type
 
template<typename T >
using is_available_t = typename is_available< T >::type
 

Functions

template<typename TraitT >
std::string as_string ()
 

Class Documentation

◆ tim::trait::api_components

struct tim::trait::api_components
template<typename T, typename Tag>
struct tim::trait::api_components< T, Tag >

trait that designates components in an API (tim::api)

Definition at line 331 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::api_components< T, Tag >:
Class Members
typedef type_list<> type

◆ tim::trait::api_input_archive

struct tim::trait::api_input_archive
template<typename Api>
struct tim::trait::api_input_archive< Api >

trait that configures the default input archive type for an entire API specification, e.g. TIMEMORY_API (which is struct tim::project::timemory). The input archive format of individual components is determined from the derived tim::trait::input_archive

Definition at line 520 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::api_input_archive< Api >:
Class Members
typedef TIMEMORY_INPUT_ARCHIVE type

◆ tim::trait::cache

struct tim::trait::cache
template<typename T>
struct tim::trait::cache< T >

trait that specifies the intermediate data type that will hold the relevant data required by the component. This is useful for when multiple components read different parts of the same file (e.g. /proc/<PID>/io) or an API reports data in a larger data structure than the scope of the component (e.g. rusage) but multiple components require access to this data structure

Definition at line 866 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::cache< T >:
Class Members
typedef null_type type

◆ tim::trait::component_apis

struct tim::trait::component_apis
template<typename T>
struct tim::trait::component_apis< T >

trait to specify the APIs that the component is logically a part of

Definition at line 116 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::component_apis< T >:
Class Members
typedef type_list<> type

◆ tim::trait::component_apis< component::data_tracker< InpT, Tag > >

struct tim::trait::component_apis< component::data_tracker< InpT, Tag > >
template<typename InpT, typename Tag>
struct tim::trait::component_apis< component::data_tracker< InpT, Tag > >

Definition at line 69 of file types.hpp.

+ Collaboration diagram for tim::trait::component_apis< component::data_tracker< InpT, Tag > >:
Class Members
typedef type_list< TIMEMORY_API, logger, agnostic > type

◆ tim::trait::component_apis< component::gotcha< Nt, ComponentsT, DiffT > >

struct tim::trait::component_apis< component::gotcha< Nt, ComponentsT, DiffT > >
template<size_t Nt, typename ComponentsT, typename DiffT>
struct tim::trait::component_apis< component::gotcha< Nt, ComponentsT, DiffT > >

Definition at line 53 of file types.hpp.

+ Collaboration diagram for tim::trait::component_apis< component::gotcha< Nt, ComponentsT, DiffT > >:
Class Members
typedef type_list< gotcha, external, supports_linux > type

◆ tim::trait::component_value_type

struct tim::trait::component_value_type
template<typename T, bool>
struct tim::trait::component_value_type< T, bool >

trait that can be used to override the evaluation of the tim::trait::collects_data trait. It checks to see if tim::trait::data is specialized and, if not, evaluates to:

typename T::value_type

Unless the component has been marked as not available. If the component is not available, the 'type' will always be void. When a component is available, this trait will return the value type for a component regardless of whether it base specified within the component definition or if it was declared via a type-trait. Use the tim::trait::collects_data for a constexpr boolean 'value' for whether this value is a null type.

Definition at line 120 of file types.hpp.

+ Collaboration diagram for tim::trait::component_value_type< T, bool >:

◆ tim::trait::component_value_type< T, false >

struct tim::trait::component_value_type< T, false >
template<typename T>
struct tim::trait::component_value_type< T, false >

Definition at line 360 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::component_value_type< T, false >:
Class Members
typedef void type

◆ tim::trait::component_value_type< T, true >

struct tim::trait::component_value_type< T, true >
template<typename T>
struct tim::trait::component_value_type< T, true >

Definition at line 353 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::component_value_type< T, true >:
Class Members
typedef conditional_t<!is_same< type_list<>, typename type >::value, typename type, typename value_type > type

◆ tim::trait::data

struct tim::trait::data
template<typename T>
struct tim::trait::data< T >

trait to specify the value type of a component before the definition of the component

Definition at line 104 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::data< T >:
Class Members
typedef type_list<> type

◆ tim::trait::derivation_types< component::printer >

struct tim::trait::derivation_types< component::printer >

Definition at line 53 of file types.hpp.

+ Collaboration diagram for tim::trait::derivation_types< component::printer >:
Class Members
typedef type_list< type_list< timestamp > > type

◆ tim::trait::input_archive

struct tim::trait::input_archive
template<typename T, typename Api>
struct tim::trait::input_archive< T, Api >

trait that configures output archive type

Definition at line 550 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::input_archive< T, Api >:
Class Members
typedef typename type type

◆ tim::trait::ompt_handle

struct tim::trait::ompt_handle
template<typename T>
struct tim::trait::ompt_handle< T >

Definition at line 279 of file types.hpp.

+ Collaboration diagram for tim::trait::ompt_handle< T >:

◆ tim::trait::python_args

struct tim::trait::python_args
template<int OpT, typename T>
struct tim::trait::python_args< OpT, T >

trait that designates the type supports these arguments from python. Specializations MUST be structured as either one tim::type_list<...> or a tim::type_list<...> of tim::type_list<...>. The first argument is a TIMEMORY_OPERATION enumerated type and for each inner tim::type_list, a python member function for the stand-alone component will be generated with those arguments. E.g. to create a custom store member function accepting integer:

foo = timemory.component.CaliperLoopMarker("example")
foo.start()
for i in range(10):
foo.store(i) # store member function accepting integer
# ...
foo.stop()

The type-trait specification would look like this:

template <>
struct python_args<TIMEMORY_STORE, component::caliper_loop_marker>
{
using type = type_list<size_t>;
};
@ TIMEMORY_STORE
Definition: enum.h:685
type_list< type_list<> > type

Definition at line 847 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::python_args< OpT, T >:
Class Members
typedef type_list< type_list<> > type

◆ tim::trait::python_args< TIMEMORY_MARK_BEGIN, component::caliper_loop_marker >

struct tim::trait::python_args< TIMEMORY_MARK_BEGIN, component::caliper_loop_marker >

Definition at line 59 of file timemory.hpp.

+ Collaboration diagram for tim::trait::python_args< TIMEMORY_MARK_BEGIN, component::caliper_loop_marker >:
Class Members
typedef type_list< size_t > type

◆ tim::trait::python_args< TIMEMORY_MARK_END, component::caliper_loop_marker >

struct tim::trait::python_args< TIMEMORY_MARK_END, component::caliper_loop_marker >

Definition at line 65 of file timemory.hpp.

+ Collaboration diagram for tim::trait::python_args< TIMEMORY_MARK_END, component::caliper_loop_marker >:
Class Members
typedef type_list< size_t > type

◆ tim::trait::python_args< TIMEMORY_RECORD, component::caliper_loop_marker >

struct tim::trait::python_args< TIMEMORY_RECORD, component::caliper_loop_marker >

Definition at line 53 of file timemory.hpp.

+ Collaboration diagram for tim::trait::python_args< TIMEMORY_RECORD, component::caliper_loop_marker >:
Class Members
typedef type_list< size_t > type

◆ tim::trait::statistics

struct tim::trait::statistics
template<typename T>
struct tim::trait::statistics< T >

trait that specifies the data type of the statistics

Definition at line 447 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::statistics< T >:
Class Members
typedef tuple<> type

◆ tim::trait::units

struct tim::trait::units
template<typename T>
struct tim::trait::units< T >

trait that specifies the units

Definition at line 490 of file type_traits.hpp.

+ Collaboration diagram for tim::trait::units< T >:
Class Members
typedef string display_type
typedef int64_t type

Typedef Documentation

◆ component_apis_t

template<typename T >
using tim::trait::component_apis_t = typedef typename component_apis<T>::type

Definition at line 122 of file type_traits.hpp.

◆ component_value_type_t

template<typename T >
using tim::trait::component_value_type_t = typedef typename component_value_type<T, is_available<T>::value>::type

Definition at line 366 of file type_traits.hpp.

◆ data_t

template<typename Tp >
using tim::trait::data_t = typedef typename data<Tp>::type

Definition at line 50 of file types.hpp.

◆ input_archive_t

Definition at line 321 of file types.hpp.

◆ is_available_t

template<typename T >
using tim::trait::is_available_t = typedef typename is_available<T>::type

Definition at line 362 of file types.hpp.

◆ output_archive_t

Definition at line 324 of file types.hpp.

◆ python_args_t

template<int OpT, typename T >
using tim::trait::python_args_t = typedef typename python_args<OpT, T>::type

Definition at line 855 of file type_traits.hpp.

◆ runtime_configurable

Definition at line 126 of file types.hpp.

Function Documentation

◆ as_string()

template<typename TraitT >
std::string tim::trait::as_string ( )
inline

Definition at line 62 of file type_traits.hpp.

63{
64 constexpr bool _val = TraitT::value;
65 return (_val) ? "true" : "false";
66}

Referenced by tim::component::printer::store().