25#ifndef __PROFILER_HPP__
26#define __PROFILER_HPP__
31#include <apex_api.hpp>
33#include "core/rt_graph.hpp"
34#if defined(SIRIUS_GPU) && defined(SIRIUS_CUDA_NVTX)
35#include "core/acc/nvtx_profiler.hpp"
40extern ::rt_graph::Timer global_rtgraph_timer;
42#if defined(SIRIUS_CUDA_NVTX)
43extern acc::nvtxprofiler::Timer global_nvtx_timer;
48#if defined(SIRIUS_PROFILE)
49#define PROFILER_CONCAT_IMPL(x, y) x##y
50#define PROFILER_CONCAT(x, y) PROFILER_CONCAT_IMPL(x, y)
52#if defined(SIRIUS_CUDA_NVTX)
53 #define PROFILE(identifier) \
54 acc::nvtxprofiler::ScopedTiming PROFILER_CONCAT(GeneratedScopedTimer, __COUNTER__)(identifier, global_nvtx_timer); \
55 ::rt_graph::ScopedTiming PROFILER_CONCAT(GeneratedScopedTimer, __COUNTER__)(identifier, global_rtgraph_timer);
56 #define PROFILE_START(identifier) \
57 global_nvtx_timer.start(identifier); \
58 global_rtgraph_timer.start(identifier);
59 #define PROFILE_STOP(identifier) \
60 global_rtgraph_timer.stop(identifier); \
61 global_nvtx_timer.stop(identifier);
63 #define PROFILE(identifier) \
64 ::rt_graph::ScopedTiming PROFILER_CONCAT(GeneratedScopedTimer, __COUNTER__)(identifier, global_rtgraph_timer);
65 #define PROFILE_START(identifier) \
66 global_rtgraph_timer.start(identifier);
67 #define PROFILE_STOP(identifier) \
68 global_rtgraph_timer.stop(identifier);
73 #define PROFILE_START(...)
74 #define PROFILE_STOP(...)
Namespace of the SIRIUS library.