Fix hipSYCL build with CUDA target
[alexxy/gromacs.git] / src / config.h.cmakein
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team.
5  * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
6  * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
7  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8  * and including many others, as listed in the AUTHORS file in the
9  * top-level source directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37 /*! \libinternal \file
38  * \brief
39  * Include file for configuration macros from the build system.
40  *
41  * This header is not installed, so headers must not reference macros defined
42  * here.
43  *
44  * \inlibraryapi
45  */
46 #ifndef GMX_CONFIG_H
47 #define GMX_CONFIG_H
48
49 /* TODO: For now, disable Doxygen warnings from here */
50 /*! \cond */
51
52 /* Work around broken calloc() */
53 #cmakedefine01 GMX_BROKEN_CALLOC
54
55 /* Do not optimize FFTW setups (not needed with SSE FFT kernels) */
56 #cmakedefine01 GMX_DISABLE_FFTW_MEASURE
57
58 /* Use FFTW3 FFT library */
59 #cmakedefine01 GMX_FFT_FFTW3
60
61 /* Use the ARM Performance library with FFTW3 compatibility */
62 #cmakedefine01 GMX_FFT_ARMPL_FFTW3
63
64 /* Use MKL FFT library */
65 #cmakedefine01 GMX_FFT_MKL
66
67 /* Use built in fftpack FFT library */
68 #cmakedefine01 GMX_FFT_FFTPACK
69
70 /* Target platform is x86 or x86_64 */
71 #cmakedefine01 GMX_TARGET_X86
72
73 /** Define if we are building natively on Windows */
74 #cmakedefine01 GMX_NATIVE_WINDOWS
75
76 /** Define if we are building for Cygwin */
77 #cmakedefine01 GMX_CYGWIN
78
79 /* SSE2 was selected for SIMD instruction set level */
80 #cmakedefine01 GMX_SIMD_X86_SSE2
81
82 /* SSE4.1 was selected as SIMD instructions */
83 #cmakedefine01 GMX_SIMD_X86_SSE4_1
84
85 /* AVX 128-bit FMA was selected as SIMD instructions */
86 #cmakedefine01 GMX_SIMD_X86_AVX_128_FMA
87
88 /* AVX 256-bit was selected as SIMD instructions */
89 #cmakedefine01 GMX_SIMD_X86_AVX_256
90
91 /* AVX2 256-bit SIMD instruction set level was selected */
92 #cmakedefine01 GMX_SIMD_X86_AVX2_256
93
94 /* AVX2 128-bit SIMD instruction set level was selected */
95 #cmakedefine01 GMX_SIMD_X86_AVX2_128
96
97 /* AVX-512F foundation level instruction SIMD */
98 #cmakedefine01 GMX_SIMD_X86_AVX_512
99
100 /* AVX-512ER foundation level instruction SIMD */
101 #cmakedefine01 GMX_SIMD_X86_AVX_512_KNL
102
103 /* ARM (AArch64) NEON Advanced SIMD instruction set level was selected */
104 #cmakedefine01 GMX_SIMD_ARM_NEON_ASIMD
105
106 /* ARM (SVE) Scalable Vector extensions */
107 #cmakedefine01 GMX_SIMD_ARM_SVE
108
109 /* SVE vector length */
110 #define GMX_SIMD_ARM_SVE_LENGTH_VALUE @GMX_SIMD_ARM_SVE_LENGTH_VALUE@
111
112 /* IBM VSX was selected as SIMD instructions (Power 7 and later) */
113 #cmakedefine01 GMX_SIMD_IBM_VSX
114
115 /* Reference SIMD implementation for testing */
116 #cmakedefine01 GMX_SIMD_REFERENCE
117
118 /* String for SIMD instruction choice (for writing to log files and stdout) */
119 #define GMX_SIMD_STRING "@GMX_SIMD_ACTIVE@"
120
121 /* Calling convention string (if any) for routines with SIMD variable args */
122 #define gmx_simdcall @GMX_SIMD_CALLING_CONVENTION@
123
124 /* Target mantissa accuracy for SIMD single precision math */
125 #define GMX_SIMD_ACCURACY_BITS_SINGLE @GMX_SIMD_ACCURACY_BITS_SINGLE@
126
127 /* Target mantissa accuracy for SIMD double precision math */
128 #define GMX_SIMD_ACCURACY_BITS_DOUBLE @GMX_SIMD_ACCURACY_BITS_DOUBLE@
129
130 /* Enable code that requires AVX-512 instruction support, without GMX_SIMD=AVX_512 */
131 #cmakedefine01 SIMD_AVX_512_CXX_SUPPORTED
132
133 /* Whether NBNXM and other SIMD kernels should be compiled */
134 #cmakedefine01 GMX_USE_SIMD_KERNELS
135
136 /* Integer byte order is big endian. */
137 #cmakedefine01 GMX_INTEGER_BIG_ENDIAN
138
139 /* Use our own instead of system XDR libraries */
140 #cmakedefine01 GMX_INTERNAL_XDR
141
142 /* Compile to use TNG library */
143 #cmakedefine01 GMX_USE_TNG
144
145 /* Add support for tracing using Extrae */
146 #cmakedefine01 HAVE_EXTRAE
147
148 /* Use MPI (with mpicc) for parallelization */
149 #cmakedefine01 GMX_LIB_MPI
150
151 /* Use threads_mpi for parallelization */
152 #cmakedefine01 GMX_THREAD_MPI
153
154 /* Make a parallel version of GROMACS using message passing
155    (MPI or thread_mpi) */
156 #define GMX_MPI (GMX_LIB_MPI || GMX_THREAD_MPI)
157
158 /* Use OpenMP multithreading */
159 #cmakedefine01 GMX_OPENMP
160
161 /* Use the Portable Hardware Locality package (hwloc) */
162 #cmakedefine01 GMX_USE_HWLOC
163
164 /* Library version found for hwloc during configuration time */
165 #define GMX_HWLOC_API_VERSION @GMX_HWLOC_API_VERSION@
166
167 /* Can and should use nice(3) to set priority */
168 #cmakedefine01 GMX_USE_NICE
169
170 /* Maximum number of OpenMP threads supported */
171 #define GMX_OPENMP_MAX_THREADS @GMX_OPENMP_MAX_THREADS@
172
173 /* Use if we cannot rename checkpoints */
174 #cmakedefine01 GMX_NO_RENAME
175
176 /* Use sub-counters */
177 #cmakedefine01 GMX_CYCLE_SUBCOUNTERS
178
179 /* Compile with plugin support */
180 #cmakedefine01 GMX_USE_PLUGINS
181
182 /* Fallback path for VMD plug-ins */
183 #define GMX_VMD_PLUGIN_PATH "@GMX_VMD_PLUGIN_PATH@"
184
185 /* Default path for DSSP program */
186 #define GMX_DSSP_PROGRAM_PATH "@GMX_DSSP_PROGRAM_PATH@"
187
188 /* Define when pthreads are used */
189 #cmakedefine THREAD_PTHREADS
190
191 /* Define when Windows threads are used */
192 #cmakedefine THREAD_WINDOWS
193
194 /* Define for busy wait option  */
195 /* See gmxpre-config.h.cmakein for explanation for the #ifndef */
196 #ifndef TMPI_WAIT_FOR_NO_ONE
197 #cmakedefine01 TMPI_WAIT_FOR_NO_ONE
198 #endif
199
200 /* Define for copy buffer option */
201 #cmakedefine TMPI_COPY_BUFFER
202
203 /* Define for tmpi warnings option */
204 #cmakedefine TMPI_WARNINGS
205
206 /* Define for profiling option */
207 #cmakedefine TMPI_PROFILE
208
209 /* Define for Linux pthread_setaffinity_np */
210 #cmakedefine HAVE_PTHREAD_SETAFFINITY
211
212 /* Define for X-Windows */
213 #cmakedefine01 GMX_X11
214
215 /* Enable x86 gcc inline assembly */
216 #cmakedefine01 GMX_X86_GCC_INLINE_ASM
217
218 /* Define if any type of GPU acceleration is compiled */
219 #cmakedefine01 GMX_GPU
220
221 /* Define if CUDA GPU acceleration is compiled */
222 #cmakedefine01 GMX_GPU_CUDA
223
224 /* Define if OpenCL GPU acceleration is compiled */
225 #cmakedefine01 GMX_GPU_OPENCL
226
227 /* Define if SYCL GPU acceleration is compiled */
228 #cmakedefine01 GMX_GPU_SYCL
229
230 /* Define if hipSYCL is used for SYCL support (otherwise DPCPP is assumed) */
231 #cmakedefine01 GMX_SYCL_HIPSYCL
232
233 // Define if hipSYCL has HIP target(s)
234 #cmakedefine01 GMX_HIPSYCL_HAVE_HIP_TARGET
235
236 // Define if hipSYCL has CUDA target(s)
237 #cmakedefine01 GMX_HIPSYCL_HAVE_CUDA_TARGET
238
239 /* Define if Intel's DPCPP is used (default unless hipSYCL is chosen) */
240 #define GMX_SYCL_DPCPP (!GMX_SYCL_HIPSYCL && GMX_GPU_SYCL)
241
242 /* Use a single compilation unit when compiling the CUDA (non-bonded) kernels.  */
243 #cmakedefine01 GMX_CUDA_NB_SINGLE_COMPILATION_UNIT
244
245 /* Use CUDA-aware MPI.  */
246 #cmakedefine01 HAVE_CUDA_AWARE_MPI
247
248 /* Define if HeFFTe library found */
249 #cmakedefine01 Heffte_FOUND
250
251 /* Cluster size used by nonbonded kernel. Should be 8 for NVIDIA/AMD and 4 for Intel */
252 #define GMX_GPU_NB_CLUSTER_SIZE @GMX_GPU_NB_CLUSTER_SIZE@
253
254 /* Define constants for build types (starting at 1 to make sure undefined values don't match) */
255 #define CMAKE_BUILD_TYPE_DEBUG 1
256 #define CMAKE_BUILD_TYPE_RELEASE 2
257 #define CMAKE_BUILD_TYPE_RELWITHDEBINFO 3
258 #define CMAKE_BUILD_TYPE_MINSIZEREL 4
259 #define CMAKE_BUILD_TYPE_REFERENCE 5
260 #define CMAKE_BUILD_TYPE_RELWITHASSERT 6
261 #define CMAKE_BUILD_TYPE_PROFILE 7
262 #define CMAKE_BUILD_TYPE_TSAN 8
263 #define CMAKE_BUILD_TYPE_ASAN 9
264 #define CMAKE_BUILD_TYPE_MSAN 10
265 #define CMAKE_BUILD_TYPE_UBSAN 11
266 #cmakedefine CMAKE_BUILD_TYPE CMAKE_BUILD_TYPE_@CMAKE_BUILD_TYPE_UPPER@
267
268 /* Define relative path to OpenCL kernels */
269 #define GMX_INSTALL_OCLDIR "@GMX_INSTALL_OCLDIR@"
270
271 /* Minimum required OpenCL version support (both API and device) - split into integer components for convenience */
272 #define REQUIRED_OPENCL_MIN_VERSION_MAJOR @REQUIRED_OPENCL_MIN_VERSION_MAJOR@
273 #define REQUIRED_OPENCL_MIN_VERSION_MINOR @REQUIRED_OPENCL_MIN_VERSION_MINOR@
274
275 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
276 #cmakedefine01 HAVE_FSEEKO
277
278 /* Define to 1 if _fseeki64 (and presumably _fseeki64) exists and is declared. */
279 //NOLINTNEXTLINE(bugprone-reserved-identifier)
280 #cmakedefine01 HAVE__FSEEKI64
281
282 /* Have io.h (windows)*/
283 #cmakedefine01 HAVE_IO_H
284
285 /* Define to 1 if you have the posix_memalign() function. */
286 #cmakedefine01 HAVE_POSIX_MEMALIGN
287
288 /* Define to 1 if you have the memalign() function. */
289 #cmakedefine01 HAVE_MEMALIGN
290
291 /* Define to 1 if you have the MSVC _aligned_malloc() function. */
292 //NOLINTNEXTLINE(bugprone-reserved-identifier)
293 #cmakedefine01 HAVE__ALIGNED_MALLOC
294
295 /* Define to 1 if you have the clock_gettime() function. */
296 #cmakedefine01 HAVE_CLOCK_GETTIME
297
298 /* Define to 1 if you have the gettimeofday() function. */
299 #cmakedefine01 HAVE_GETTIMEOFDAY
300
301 /* Define to 1 if you have the rdtscp instruction (ie essentially all x86 still in use. */
302 #cmakedefine01 GMX_USE_RDTSCP
303
304 /* Define to 1 if you have the fsync() function. */
305 #cmakedefine01 HAVE_FSYNC
306
307 /* Define to 1 if you have the Windows _commit() function. */
308 //NOLINTNEXTLINE(bugprone-reserved-identifier)
309 #cmakedefine01 HAVE__COMMIT
310
311 /* Define to 1 if you have the fileno() function. */
312 #cmakedefine01 HAVE_FILENO
313
314 /* Define to 1 if you have the _fileno() function. */
315 //NOLINTNEXTLINE(bugprone-reserved-identifier)
316 #cmakedefine01 HAVE__FILENO
317
318 /* Define to 1 if you have the sigaction() function. */
319 #cmakedefine01 HAVE_SIGACTION
320
321 /* Define for the GNU __builtin_clz() function. */
322 #cmakedefine01 HAVE_BUILTIN_CLZ
323
324 /* Define for the GNU __builtin_clzll() function. */
325 #cmakedefine01 HAVE_BUILTIN_CLZLL
326
327 /* Define for the MSVC _BitScanReverse() function. */
328 #cmakedefine01 HAVE_BITSCANREVERSE
329
330 /* Define for the MSVC _BitScanReverse64() function. */
331 #cmakedefine01 HAVE_BITSCANREVERSE64
332
333 /* Define for the IBM xlc++ __cntlz4() function. */
334 #cmakedefine01 HAVE_CNTLZ4
335
336 /* Define for the IBM xlc++ __cntlz8() function. */
337 #cmakedefine01 HAVE_CNTLZ8
338
339 /* Define to 1 if yo have the <unistd.h> header file. */
340 #cmakedefine HAVE_UNISTD_H
341 #  ifdef __APPLE__
342 // Mac OS 13.x has a bug where dispatch.h generates an error for OpenCL builds if
343 // HAVE_UNISTD_H is merely defined, but not set to 1. Since unistd.h should always
344 // be available on this platform we simply undefine and redefine it to 1 for now
345 #    undef  HAVE_UNISTD_H
346 #    define HAVE_UNISTD_H 1
347 #endif
348
349 /* Define to 1 if yo have the <pwd.h> header file. */
350 #cmakedefine01 HAVE_PWD_H
351
352 /* Define to 1 if yo have the <dirent.h> header file. */
353 #cmakedefine01 HAVE_DIRENT_H
354
355 /* Define to 1 if you have the <sys/time.h> header file. */
356 #cmakedefine HAVE_SYS_TIME_H
357
358 /* Define to 1 if you have the <sched.h> header */
359 #cmakedefine HAVE_SCHED_H
360
361 /* Define to 1 if mm_malloc.h is present, otherwise 0 */
362 #cmakedefine01 HAVE_MM_MALLOC_H
363
364 /* Define to 1 if malloc.h is present, otherwise 0 */
365 #cmakedefine01 HAVE_MALLOC_H
366
367 /* Define to 1 if xmmintrin.h is present, otherwise 0 */
368 #cmakedefine01 HAVE_XMMINTRIN_H
369
370 /* Define to 1 if you have the sysconf() function */
371 #cmakedefine HAVE_SYSCONF
372
373 /* Define to 1 if you have the all the affinity functions in sched.h */
374 #cmakedefine01 HAVE_SCHED_AFFINITY
375
376 /* Define to 1 if _mm_malloc() is present in either mm_malloc.h,
377  * malloc.h or xmmintrin.h, and 0 otherwise. Note that you need to
378  * conditionally include the three headers too before using _mm_malloc().
379  */
380 //NOLINTNEXTLINE(bugprone-reserved-identifier)
381 #cmakedefine01 HAVE__MM_MALLOC
382
383 /* Define if SIGUSR1 is present */
384 #cmakedefine01 HAVE_SIGUSR1
385
386 /* Enable gromacs quotes */
387 #cmakedefine01 GMX_COOL_QUOTES
388
389 /* default name mangling maybe wrong on exotic plattforms */
390 #define F77_FUNC(name,NAME) name ## _
391
392 /* Define if we have pipes */
393 #cmakedefine01 HAVE_PIPES
394
395 /* Define if we have feenableexcept */
396 #cmakedefine01 HAVE_FEENABLEEXCEPT
397
398 /* Define if we have fedisableexcept */
399 #cmakedefine01 HAVE_FEDISABLEEXCEPT
400
401 /* Define if we have MKL available */
402 #cmakedefine01 HAVE_LIBMKL
403
404 /* Define if we have lmfit support */
405 #cmakedefine01 HAVE_LMFIT
406
407 /* Define if we have muparser support */
408 #cmakedefine01 HAVE_MUPARSER
409
410 /* Build using clang analyzer */
411 #cmakedefine01 GMX_CLANG_ANALYZER
412
413 /* Use Interactive Molecular Dynamics */
414 #cmakedefine01 GMX_IMD
415
416 /*! \endcond */
417
418 #endif