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.
types.hpp
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2020, The Regents of the University of California,
4// through Lawrence Berkeley National Laboratory (subject to receipt of any
5// required approvals from the U.S. Dept. of Energy). All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in all
15// copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23// SOFTWARE.
24
25#pragma once
26
29#include "timemory/enum.h"
33
34TIMEMORY_DECLARE_TEMPLATE_COMPONENT(data_tracker, typename InpT,
35 typename Tag = TIMEMORY_API)
36
37//--------------------------------------------------------------------------------------//
38//
39// APIs
40//
41//--------------------------------------------------------------------------------------//
42//
43namespace tim
44{
45namespace component
46{
47/// \typedef tim::component::data_tracker_integer
48/// \brief Specialization of \ref tim::component::data_tracker for storing signed integer
49/// data
50using data_tracker_integer = data_tracker<intmax_t, TIMEMORY_API>;
51
52/// \typedef tim::component::data_tracker_unsigned
53/// \brief Specialization of \ref tim::component::data_tracker for storing unsigned
54/// integer data
55using data_tracker_unsigned = data_tracker<size_t, TIMEMORY_API>;
56
57/// \typedef tim::component::data_tracker_floating
58/// \brief Specialization of \ref tim::component::data_tracker for storing floating point
59/// data
60using data_tracker_floating = data_tracker<double, TIMEMORY_API>;
61} // namespace component
62} // namespace tim
63//
64namespace tim
65{
66namespace trait
67{
68template <typename InpT, typename Tag>
69struct component_apis<component::data_tracker<InpT, Tag>>
70{
72};
73//
74#if defined(TIMEMORY_COMPILER_INSTRUMENTATION)
75template <typename InpT, typename Tag>
76struct is_available<component::data_tracker<InpT, Tag>> : std::false_type
77{};
78#endif
79//
80} // namespace trait
81} // namespace tim
82//
83//--------------------------------------------------------------------------------------//
84//
85// STATISTICS
86//
87//--------------------------------------------------------------------------------------//
88//
92//
93//--------------------------------------------------------------------------------------//
94//
95namespace tim
96{
97namespace trait
98{
99//
100template <typename InpT, typename Tag>
101struct base_has_accum<component::data_tracker<InpT, Tag>> : false_type
102{};
103//
104template <typename InpT, typename Tag>
105struct is_component<component::data_tracker<InpT, Tag>> : true_type
106{};
107//
108template <>
109struct python_args<TIMEMORY_RECORD, component::data_tracker_integer>
110{
111 using type = type_list<intmax_t>;
112};
113//
114template <>
115struct python_args<TIMEMORY_RECORD, component::data_tracker_unsigned>
116{
117 using type = type_list<size_t>;
118};
119//
120template <>
121struct python_args<TIMEMORY_RECORD, component::data_tracker_floating>
122{
123 using type = type_list<double>;
124};
125//
126} // namespace trait
127} // namespace tim
128//
129//--------------------------------------------------------------------------------------//
130//
132 "data_tracker_integer", "integer_data_tracker")
134 "data_tracker_unsigned", "unsigned_data_tracker")
136 "data_tracker_floating", "floating_data_tracker")
137//
138//--------------------------------------------------------------------------------------//
139//
141 data_tracker_integer, "data_integer", "Stores signed integer data w.r.t. call-graph",
142 "Useful for tracking +/- values in different call-graph contexts")
144 data_tracker_unsigned, "data_unsigned",
145 "Stores unsigned integer data w.r.t. call-graph",
146 "Useful for tracking iterations, etc. in different call-graph contexts")
148 data_tracker_floating, "data_floating",
149 "Stores double-precision fp data w.r.t. call-graph",
150 "Useful for tracking values in different call-graph contexts")
151//
152//======================================================================================//
#define TIMEMORY_METADATA_SPECIALIZATION(TYPE, LABEL, BASIC_DESC,...)
Specialization of the property specialization.
Definition: macros.hpp:288
#define TIMEMORY_PROPERTY_SPECIALIZATION(TYPE, ENUM, ID,...)
Specialization of the property specialization.
Definition: macros.hpp:223
TIMEMORY_DECLARE_TEMPLATE_COMPONENT(user_bundle, size_t Idx, typename Tag=TIMEMORY_API) TIMEMORY_BUNDLE_INDEX(ompt_bundle_idx
#define TIMEMORY_DATA_TRACKER_FLOATING
Definition: enum.h:464
#define TIMEMORY_DATA_TRACKER_INTEGER
Definition: enum.h:458
#define TIMEMORY_DATA_TRACKER_UNSIGNED
Definition: enum.h:461
@ TIMEMORY_RECORD
Definition: enum.h:686
#define TIMEMORY_STATISTICS_TYPE(COMPONENT, TYPE)
Definition: macros.hpp:207
data_tracker< intmax_t, TIMEMORY_API > data_tracker_integer
Definition: components.hpp:447
data_tracker< size_t, TIMEMORY_API > data_tracker_unsigned
Definition: components.hpp:454
data_tracker< double, TIMEMORY_API > data_tracker_floating
Definition: components.hpp:461
type_list< type_list<> > type
trait to specify the APIs that the component is logically a part of
Definition: kokkosp.cpp:39
tim::popen::TIMEMORY_PIPE * fp
for(const auto &ext :_exe_suffixes)
Definition: config.cpp:86
precision
Definition: settings.cpp:1643
lightweight tuple-alternative for meta-programming logic
Definition: types.hpp:233
trait that signifies that an implementation for the component is available. When this is set to false...
Definition: types.hpp:355