28 #ifndef LBANN_UTILS_PROFILING_HPP 29 #define LBANN_UTILS_PROFILING_HPP 31 #include <lbann_config.hpp> 33 #if defined(LBANN_HAS_CALIPER) 34 #include <caliper/cali.h> 35 #include <caliper/cali_macros.h> 37 #define LBANN_CALIPER_MARK_SCOPE(x) \ 38 CALI_CXX_MARK_SCOPE(x) 40 #define LBANN_CALIPER_MARK_FUNCTION \ 41 CALI_CXX_MARK_FUNCTION 43 #define LBANN_CALIPER_MARK_BEGIN(x) \ 46 #define LBANN_CALIPER_MARK_END(x) \ 49 #define LBANN_CALIPER_LOOP_BEGIN(label, desc) CALI_CXX_MARK_LOOP_BEGIN(label, desc) 50 #define LBANN_CALIPER_LOOP_END(label) CALI_CXX_MARK_LOOP_END(label) 51 #define LBANN_CALIPER_LOOP_ITER(label, id) CALI_CXX_MARK_LOOP_ITERATION(label, id) 54 #define LBANN_CALIPER_MARK_SCOPE(x) ((void)0) 55 #define LBANN_CALIPER_MARK_FUNCTION ((void)0) 56 #define LBANN_CALIPER_MARK_BEGIN(x) ((void)0) 57 #define LBANN_CALIPER_MARK_END(x) ((void)0) 58 #define LBANN_CALIPER_LOOP_BEGIN(...) ((void)0) 59 #define LBANN_CALIPER_LOOP_END(...) ((void)0) 60 #define LBANN_CALIPER_LOOP_ITER(...) ((void)0) 65 #if defined(LBANN_HAS_CALIPER) 66 void initialize_caliper();
67 void finalize_caliper();
68 bool is_caliper_initialized() noexcept;
75 0x3366CC, 0xDC3912, 0xFF9900, 0x109618, 0x990099, 0x3B3EAC, 0x0099C6,
76 0xDD4477, 0x66AA00, 0xB82E2E, 0x316395, 0x994499, 0x22AA99, 0xAAAA11,
77 0x6633CC, 0xE67300, 0x8B0707, 0x329262, 0x5574A6, 0x3B3EAC};
89 ProfRegion(
char const* name,
bool sync =
false);
91 ProfRegion(
char const* name,
int color,
bool sync =
false);
101 #define BASIC_PROF_REGION(NAME) ProfRegion _(NAME) 104 #endif // LBANN_UTILS_PROFILING_HPP
RAII class for a prof region.
constexpr int num_prof_colors
void prof_region_end(const char *s, bool sync)
void prof_region_begin(const char *s, int c, bool sync)
constexpr int prof_colors[num_prof_colors]
ProfRegion(char const *name, bool sync=false)
Create a prof region using an automatic color.