ryujin 2.1.1 revision 1c453cc82f1d29edf537280cd96267402ac73e60
introspection.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2020 - 2023 by the ryujin authors
4//
5
6#pragma once
7
8#include "openmp.h"
9
15
28#define CALLGRIND_START_INSTRUMENTATION \
29 do { \
30 } while (false)
31
35#define CALLGRIND_STOP_INSTRUMENTATION \
36 do { \
37 } while (false)
38
39#ifdef WITH_VALGRIND
40#undef CALLGRIND_START_INSTRUMENTATION
41#undef CALLGRIND_STOP_INSTRUMENTATION
42#include <valgrind/callgrind.h>
43#endif
44
45
49#define LIKWID_INIT
50
54#define LIKWID_CLOSE
55
68#define LIKWID_MARKER_START(opt)
69
73#define LIKWID_MARKER_STOP(opt)
74
75#ifdef WITH_LIKWID
76#undef LIKWID_INIT
77#undef LIKWID_CLOSE
78#undef LIKWID_MARKER_START
79#undef LIKWID_MARKER_STOP
80#include <likwid.h>
81
82#define LIKWID_INIT \
83 LIKWID_MARKER_INIT; \
84 RYUJIN_PARALLEL_REGION_BEGIN \
85 LIKWID_MARKER_THREADINIT; \
86 RYUJIN_PARALLEL_REGION_END
87
88#define LIKWID_CLOSE LIKWID_MARKER_CLOSE;
89#endif
90
91
102#define LSAN_DISABLE
103
107#define LSAN_ENABLE
108
109#if defined(__clang__) && defined(DEBUG)
110#if __has_feature(address_sanitizer)
111#include <sanitizer/lsan_interface.h>
112#undef LSAN_DISABLE
113#define LSAN_DISABLE __lsan_disable();
114#undef LSAN_ENABLE
115#define LSAN_ENABLE __lsan_enable();
116#endif
117#endif
118