xref: /freebsd/lib/libomp/kmp_config.h (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1 /*
2  * kmp_config.h -- Feature macros
3  */
4 //===----------------------------------------------------------------------===//
5 //
6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
7 // See https://llvm.org/LICENSE.txt for license information.
8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9 //
10 //===----------------------------------------------------------------------===//
11 #ifndef KMP_CONFIG_H
12 #define KMP_CONFIG_H
13 
14 #include "kmp_platform.h"
15 
16 // cmakedefine01 MACRO will define MACRO as either 0 or 1
17 // cmakedefine MACRO 1 will define MACRO as 1 or leave undefined
18 #define DEBUG_BUILD 0
19 #define RELWITHDEBINFO_BUILD 0
20 #define LIBOMP_USE_ITT_NOTIFY 1
21 #define USE_ITT_NOTIFY LIBOMP_USE_ITT_NOTIFY
22 #if ! LIBOMP_USE_ITT_NOTIFY
23 # define INTEL_NO_ITTNOTIFY_API
24 #endif
25 #define LIBOMP_USE_VERSION_SYMBOLS 1
26 #if LIBOMP_USE_VERSION_SYMBOLS
27 # define KMP_USE_VERSION_SYMBOLS
28 #endif
29 #define LIBOMP_HAVE_WEAK_ATTRIBUTE 1
30 #define KMP_HAVE_WEAK_ATTRIBUTE LIBOMP_HAVE_WEAK_ATTRIBUTE
31 #define LIBOMP_HAVE_PSAPI 0
32 #define KMP_HAVE_PSAPI LIBOMP_HAVE_PSAPI
33 #define LIBOMP_STATS 0
34 #define KMP_STATS_ENABLED LIBOMP_STATS
35 #define LIBOMP_HAVE_X86INTRIN_H 0
36 #define KMP_HAVE_X86INTRIN_H LIBOMP_HAVE_X86INTRIN_H
37 #define LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER 0
38 #define KMP_HAVE___BUILTIN_READCYCLECOUNTER LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER
39 #define LIBOMP_HAVE___RDTSC 0
40 #define KMP_HAVE___RDTSC LIBOMP_HAVE___RDTSC
41 #define LIBOMP_USE_DEBUGGER 0
42 #define USE_DEBUGGER LIBOMP_USE_DEBUGGER
43 #define LIBOMP_OMPT_DEBUG 0
44 #define OMPT_DEBUG LIBOMP_OMPT_DEBUG
45 #define LIBOMP_OMPT_SUPPORT 1
46 #define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT
47 #define LIBOMP_OMPD_SUPPORT 0
48 #define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT
49 #define LIBOMP_OMPX_TASKGRAPH 0
50 #define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH
51 #define LIBOMP_PROFILING_SUPPORT 0
52 #define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT
53 #define LIBOMP_OMPT_OPTIONAL 1
54 #define OMPT_OPTIONAL LIBOMP_OMPT_OPTIONAL
55 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
56 #define LIBOMP_USE_ADAPTIVE_LOCKS 1
57 #else
58 #define LIBOMP_USE_ADAPTIVE_LOCKS 0
59 #endif // } FreeBSD customization
60 #define KMP_USE_ADAPTIVE_LOCKS LIBOMP_USE_ADAPTIVE_LOCKS
61 #define KMP_DEBUG_ADAPTIVE_LOCKS 0
62 #define LIBOMP_USE_INTERNODE_ALIGNMENT 0
63 #define KMP_USE_INTERNODE_ALIGNMENT LIBOMP_USE_INTERNODE_ALIGNMENT
64 #define LIBOMP_ENABLE_ASSERTIONS 1
65 #define KMP_USE_ASSERT LIBOMP_ENABLE_ASSERTIONS
66 #define LIBOMP_USE_HIER_SCHED 0
67 #define KMP_USE_HIER_SCHED LIBOMP_USE_HIER_SCHED
68 #define STUBS_LIBRARY 0
69 #define LIBOMP_USE_HWLOC 0
70 #define KMP_USE_HWLOC LIBOMP_USE_HWLOC
71 #define LIBOMP_ENABLE_SHARED 1
72 #define KMP_DYNAMIC_LIB LIBOMP_ENABLE_SHARED
73 #if KMP_ARCH_X86 // FreeBSD customization {
74 #define KMP_ARCH_STR "IA-32"
75 #elif KMP_ARCH_X86_64
76 #define KMP_ARCH_STR "Intel(R) 64"
77 #elif KMP_ARCH_AARCH64
78 #define KMP_ARCH_STR "AARCH64"
79 #elif KMP_ARCH_PPC64
80 #define KMP_ARCH_STR "PPC64BE"
81 #elif KMP_ARCH_MIPS
82 #define KMP_ARCH_STR "MIPS"
83 #elif KMP_ARCH_MIPS64
84 #define KMP_ARCH_STR "MIPS64"
85 #elif KMP_ARCH_RISCV64
86 #define KMP_ARCH_STR "RISCV64"
87 #else
88 #error Unknown KMP_ARCH value
89 #endif // } FreeBSD customization
90 #define KMP_LIBRARY_FILE "libomp.so"
91 #define KMP_VERSION_MAJOR 5
92 #define KMP_VERSION_MINOR 0
93 #define MSVC 0
94 #define KMP_MSVC_COMPAT MSVC
95 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
96 #define LIBOMP_HAVE_WAITPKG_INTRINSICS 1
97 #else
98 #define LIBOMP_HAVE_WAITPKG_INTRINSICS 0
99 #endif // } FreeBSD customization
100 #define KMP_HAVE_WAITPKG_INTRINSICS LIBOMP_HAVE_WAITPKG_INTRINSICS
101 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
102 #define LIBOMP_HAVE_RTM_INTRINSICS 1
103 #else
104 #define LIBOMP_HAVE_RTM_INTRINSICS 0
105 #endif // } FreeBSD customization
106 #define KMP_HAVE_RTM_INTRINSICS LIBOMP_HAVE_RTM_INTRINSICS
107 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
108 #define LIBOMP_HAVE_IMMINTRIN_H 1
109 #else
110 #define LIBOMP_HAVE_IMMINTRIN_H 0
111 #endif // } FreeBSD customization
112 #define KMP_HAVE_IMMINTRIN_H LIBOMP_HAVE_IMMINTRIN_H
113 #define LIBOMP_HAVE_INTRIN_H 0
114 #define KMP_HAVE_INTRIN_H LIBOMP_HAVE_INTRIN_H
115 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
116 #define LIBOMP_HAVE_ATTRIBUTE_WAITPKG 1
117 #else
118 #define LIBOMP_HAVE_ATTRIBUTE_WAITPKG 0
119 #endif // } FreeBSD customization
120 #define KMP_HAVE_ATTRIBUTE_WAITPKG LIBOMP_HAVE_ATTRIBUTE_WAITPKG
121 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
122 #define LIBOMP_HAVE_ATTRIBUTE_RTM 1
123 #else
124 #define LIBOMP_HAVE_ATTRIBUTE_RTM 0
125 #endif // } FreeBSD customization
126 #define KMP_HAVE_ATTRIBUTE_RTM LIBOMP_HAVE_ATTRIBUTE_RTM
127 #define LIBOMP_ARCH_AARCH64_A64FX 0
128 #define KMP_ARCH_AARCH64_A64FX LIBOMP_ARCH_AARCH64_A64FX
129 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
130 #define LIBOMP_HAVE_XMMINTRIN_H 1
131 #else
132 #define LIBOMP_HAVE_XMMINTRIN_H 0
133 #endif // } FreeBSD customization
134 #define KMP_HAVE_XMMINTRIN_H LIBOMP_HAVE_XMMINTRIN_H
135 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization {
136 #define LIBOMP_HAVE__MM_MALLOC 1
137 #else
138 #define LIBOMP_HAVE__MM_MALLOC 0
139 #endif // } FreeBSD customization
140 #define KMP_HAVE__MM_MALLOC LIBOMP_HAVE__MM_MALLOC
141 #define LIBOMP_HAVE_ALIGNED_ALLOC 1
142 #define KMP_HAVE_ALIGNED_ALLOC LIBOMP_HAVE_ALIGNED_ALLOC
143 #define LIBOMP_HAVE_POSIX_MEMALIGN 1
144 #define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN
145 #define LIBOMP_HAVE__ALIGNED_MALLOC 0
146 #define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC
147 #define OPENMP_ENABLE_LIBOMPTARGET 0
148 #define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET
149 
150 // Configured cache line based on architecture
151 #if KMP_ARCH_PPC64
152 # define CACHE_LINE 128
153 #elif KMP_ARCH_AARCH64_A64FX
154 # define CACHE_LINE 256
155 #else
156 # define CACHE_LINE 64
157 #endif
158 
159 #if ! KMP_32_BIT_ARCH
160 # define BUILD_I8 1
161 #endif
162 
163 #define KMP_NESTED_HOT_TEAMS 1
164 #define KMP_ADJUST_BLOCKTIME 1
165 #define BUILD_PARALLEL_ORDERED 1
166 #define KMP_ASM_INTRINS 1
167 #define USE_ITT_BUILD LIBOMP_USE_ITT_NOTIFY
168 #define INTEL_ITTNOTIFY_PREFIX __kmp_itt_
169 #if ! KMP_MIC
170 # define USE_LOAD_BALANCE 1
171 #endif
172 #if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN)
173 # define KMP_TDATA_GTID 1
174 #endif
175 #if STUBS_LIBRARY
176 # define KMP_STUB 1
177 #endif
178 #if DEBUG_BUILD || RELWITHDEBINFO_BUILD
179 # define KMP_DEBUG 1
180 #endif
181 
182 #if KMP_OS_WINDOWS
183 # define KMP_WIN_CDECL
184 #else
185 # define BUILD_TV
186 # define KMP_GOMP_COMPAT
187 #endif
188 
189 // use shared memory with dynamic library (except Android, where shm_*
190 // functions don't exist).
191 #if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !__ANDROID__
192 #define KMP_USE_SHM
193 #endif
194 #endif // KMP_CONFIG_H
195