12 #include <initializer_list>
15 #include <type_traits>
16 #include <unordered_set>
18 #if defined(NRN_CALIPER)
19 #include <caliper/cali.h>
22 #ifdef CORENEURON_CUDA_PROFILING
23 #include <cuda_profiler_api.h>
34 #if defined(LIKWID_PERFMON)
49 template <
class... TProfilerImpl>
52 #pragma clang diagnostic push
53 #pragma clang diagnostic ignored "-Wunused-value"
153 #pragma clang diagnostic pop
165 const char* env_p = std::getenv(
"NRN_PROFILE_REGIONS");
167 std::string regions_str(env_p);
168 std::stringstream ss(regions_str);
171 while (std::getline(ss, region,
',')) {
205 template <
class... TProfilerImpl>
206 inline std::unordered_set<std::string>
Instrumentor<TProfilerImpl...>::regions_to_measure;
208 #if defined(NRN_CALIPER)
212 CALI_MARK_BEGIN(
name);
230 #ifdef CORENEURON_CUDA_PROFILING
232 struct CudaProfiling {
260 PAT_record(PAT_STATE_ON);
264 PAT_record(PAT_STATE_OFF);
281 TAU_ENABLE_INSTRUMENTATION();
285 TAU_DISABLE_INSTRUMENTATION();
295 #if defined(LIKWID_PERFMON)
299 LIKWID_MARKER_START(
name);
303 LIKWID_MARKER_STOP(
name);
314 { LIKWID_MARKER_THREADINIT; }
334 #if defined NRN_CALIPER
337 #ifdef CORENEURON_CUDA_PROFILING
338 detail::CudaProfiling,
346 #if defined(LIKWID_PERFMON)
static void phase_end(const char *name)
static void start_profile()
static void init_profile()
static void stop_profile()
static void finalize_profile()
static void phase_begin(const char *name)
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
Instrumentation infrastructure for benchmarking and profiling.
static void initialize_regions_from_env()
Initialize regions to track from the NRN_PROFILE_REGIONS environment variable.
static void start_profile()
Globally activate the collection of profiling data.
static void finalize_profile()
Finalize the profiler.
static void stop_profile()
Globally deactivate the collection of profiling data.
static bool is_region_to_track(const char *name)
Check if a given region name should be tracked.
static std::unordered_set< std::string > regions_to_measure
Caliper regions that we want to measure.
static void init_profile()
Initialize the profiler.
static void phase_end(const char *name)
Deactivate the collection of profiling data within a code region.
static void phase_begin(const char *name)
Activate the collection of profiling data within a code region.
static void finalize_profile()
static void phase_begin(const char *name)
static void phase_end(const char *name)
static void init_profile()
static void stop_profile()
static void start_profile()