File indexing completed on 2025-01-18 09:59:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef g4timemory_hh
0035 #define g4timemory_hh 1
0036
0037
0038 #ifndef G4GMAKE
0039 # include "G4GlobalConfig.hh"
0040 #endif
0041
0042 #include "globals.hh"
0043
0044 #include <cstddef>
0045 #include <functional>
0046 #include <string>
0047 #include <utility>
0048
0049
0050
0051 #ifdef GEANT4_USE_TIMEMORY
0052
0053 # include <timemory/timemory.hpp>
0054
0055 namespace g4tim
0056 {
0057 using namespace tim;
0058 }
0059
0060 using G4AutoTimer = g4tim::auto_timer;
0061
0062 #else
0063
0064 # include <ostream>
0065 # include <string>
0066
0067 namespace g4tim
0068 {
0069
0070
0071
0072 struct dummy
0073 {
0074 template <typename... _Types, typename... _Args>
0075 static void configure(_Args&&...)
0076 {}
0077 template <typename... _Args>
0078 dummy(_Args&&...)
0079 {}
0080 ~dummy() = default;
0081 dummy(const dummy&) = default;
0082 dummy(dummy&&) = default;
0083 dummy& operator=(const dummy&) = default;
0084 dummy& operator=(dummy&&) = default;
0085
0086 void record() {}
0087 void start() {}
0088 void stop() {}
0089 void push() {}
0090 void pop() {}
0091 void reset() {}
0092 void report_at_exit(bool) {}
0093 template <typename... _Args>
0094 void mark_begin(_Args&&...)
0095 {}
0096 template <typename... _Args>
0097 void mark_end(_Args&&...)
0098 {}
0099 friend std::ostream& operator<<(std::ostream& os, const dummy&)
0100 {
0101 return os;
0102 }
0103 };
0104
0105 }
0106
0107
0108 # define TIMEMORY_INIT(...)
0109 # define TIMEMORY_FINALIZE()
0110 # define TIMEMORY_CONFIGURE(...)
0111
0112
0113 # define TIMEMORY_BASIC_LABEL(...) std::string("")
0114 # define TIMEMORY_LABEL(...) std::string("")
0115 # define TIMEMORY_JOIN(...) std::string("")
0116
0117
0118 # define TIMEMORY_BLANK_MARKER(...)
0119 # define TIMEMORY_BASIC_MARKER(...)
0120 # define TIMEMORY_MARKER(...)
0121
0122
0123 # define TIMEMORY_BLANK_POINTER(...)
0124 # define TIMEMORY_BASIC_POINTER(...)
0125 # define TIMEMORY_POINTER(...)
0126
0127
0128 # define TIMEMORY_BLANK_CALIPER(...)
0129 # define TIMEMORY_BASIC_CALIPER(...)
0130 # define TIMEMORY_CALIPER(...)
0131
0132
0133 # define TIMEMORY_STATIC_BLANK_CALIPER(...)
0134 # define TIMEMORY_STATIC_BASIC_CALIPER(...)
0135 # define TIMEMORY_STATIC_CALIPER(...)
0136
0137
0138 # define TIMEMORY_CALIPER_APPLY(...)
0139 # define TIMEMORY_CALIPER_TYPE_APPLY(...)
0140
0141
0142 # define TIMEMORY_BLANK_HANDLE(...) g4tim::dummy()
0143 # define TIMEMORY_BASIC_HANDLE(...) g4tim::dummy()
0144 # define TIMEMORY_HANDLE(...) tim::dummy()
0145
0146
0147 # define TIMEMORY_BLANK_POINTER_HANDLE(...) nullptr
0148 # define TIMEMORY_BASIC_POINTER_HANDLE(...) nullptr
0149 # define TIMEMORY_POINTER_HANDLE(...) nullptr
0150
0151
0152 # define TIMEMORY_DEBUG_BLANK_MARKER(...)
0153 # define TIMEMORY_DEBUG_BASIC_MARKER(...)
0154 # define TIMEMORY_DEBUG_MARKER(...)
0155
0156
0157 # define TIMEMORY_BLANK_AUTO_TIMER(...)
0158 # define TIMEMORY_BASIC_AUTO_TIMER(...)
0159 # define TIMEMORY_AUTO_TIMER(...)
0160 # define TIMEMORY_BLANK_AUTO_TIMER_HANDLE(...)
0161 # define TIMEMORY_BASIC_AUTO_TIMER_HANDLE(...)
0162 # define TIMEMORY_AUTO_TIMER_HANDLE(...)
0163 # define TIMEMORY_DEBUG_BASIC_AUTO_TIMER(...)
0164 # define TIMEMORY_DEBUG_AUTO_TIMER(...)
0165
0166 using G4AutoTimer = g4tim::dummy;
0167
0168 #endif
0169
0170
0171
0172 #endif