ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
instrumentation.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2020 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
9
14
15#ifdef WITH_LIKWID
16#include <likwid.h>
17#else
18
24#define LIKWID_MARKER_INIT
25
26
32#define LIKWID_MARKER_THREADINIT
33
39#define LIKWID_MARKER_CLOSE
40
54#define LIKWID_MARKER_START(opt)
55
61#define LIKWID_MARKER_STOP(opt)
62
63#endif
64
66
70
71#ifdef WITH_NVTX
72#include <cuda_profiler_api.h>
73#include <nvtx3/nvToolsExt.h>
74
75#define NVTX_MARKER_INIT cudaProfilerStart()
76#define NVTX_MARKER_CLOSE cudaProfilerStop()
77#define NVTX_MARKER_START(opt) nvtxRangePushA(opt)
78#define NVTX_MARKER_STOP(opt) nvtxRangePop()
79
80#else
81
87#define NVTX_MARKER_INIT
88
94#define NVTX_MARKER_CLOSE
95
112#define NVTX_MARKER_START(opt)
113
119#define NVTX_MARKER_STOP(opt)
120
121#endif
122
124
128
141#define LSAN_DISABLE
142
148#define LSAN_ENABLE
149
150#if defined(__clang__) && defined(DEBUG)
151#if __has_feature(address_sanitizer)
152#include <sanitizer/lsan_interface.h>
153#undef LSAN_DISABLE
154#define LSAN_DISABLE __lsan_disable();
155#undef LSAN_ENABLE
156#define LSAN_ENABLE __lsan_enable();
157#endif
158#endif
159