ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
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 <compile_time_options.h>
9
14
15#ifdef WITH_LIKWID
16#include <likwid.h>
17#else
18
22#define LIKWID_MARKER_INIT
23
24
28#define LIKWID_MARKER_THREADINIT
29
33#define LIKWID_MARKER_CLOSE
34
46#define LIKWID_MARKER_START(opt)
47
51#define LIKWID_MARKER_STOP(opt)
52
53#endif
54
56
60
61#ifdef WITH_NVTX
62#include <cuda_profiler_api.h>
63#include <nvtx3/nvToolsExt.h>
64
65#define NVTX_MARKER_INIT cudaProfilerStart()
66#define NVTX_MARKER_CLOSE cudaProfilerStop()
67#define NVTX_MARKER_START(opt) nvtxRangePushA(opt)
68#define NVTX_MARKER_STOP(opt) nvtxRangePop()
69
70#else
71
75#define NVTX_MARKER_INIT
76
80#define NVTX_MARKER_CLOSE
81
96#define NVTX_MARKER_START(opt)
97
101#define NVTX_MARKER_STOP(opt)
102
103#endif
104
106
110
121#define LSAN_DISABLE
122
126#define LSAN_ENABLE
127
128#if defined(__clang__) && defined(DEBUG)
129#if __has_feature(address_sanitizer)
130#include <sanitizer/lsan_interface.h>
131#undef LSAN_DISABLE
132#define LSAN_DISABLE __lsan_disable();
133#undef LSAN_ENABLE
134#define LSAN_ENABLE __lsan_enable();
135#endif
136#endif
137