forked from lijiext/lammps
autodetect OpenMP 4.0 semantic compatibility if not explicitly set
This commit is contained in:
parent
28812b1ea7
commit
2e67aa6b47
|
@ -25,11 +25,30 @@
|
|||
// so this is what LAMMPS primarily uses. For those compilers
|
||||
// that strictly implement OpenMP 4.0 (such as GCC 9.0 and later
|
||||
// or Clang 10.0 and later), we give up default(none).
|
||||
#if LAMMPS_OMP_COMPAT == 4
|
||||
# define LMP_SHARED(...)
|
||||
# define LMP_DEFAULT_NONE default(shared)
|
||||
#else
|
||||
# define LMP_SHARED(...) shared(__VA_ARGS__)
|
||||
# define LMP_DEFAULT_NONE default(none)
|
||||
|
||||
// autodetect OpenMP compatibility if not explicitly set
|
||||
|
||||
#ifndef LAMMPS_OMP_COMPAT
|
||||
# if defined(__INTEL_COMPILER)
|
||||
# if __INTEL_COMPILER > 18
|
||||
# define LAMMPS_OMP_COMPAT 4
|
||||
# endif
|
||||
# elif defined(__clang__)
|
||||
# if __clang_major__ >= 10
|
||||
# define LAMMPS_OMP_COMPAT 4
|
||||
# endif
|
||||
# elif defined(__GNUC__)
|
||||
# if __GNUC__ >= 0
|
||||
# define LAMMPS_OMP_COMPAT 4
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if LAMMPS_OMP_COMPAT == 4
|
||||
# define LMP_SHARED(...)
|
||||
# define LMP_DEFAULT_NONE default(shared)
|
||||
#else
|
||||
# define LMP_SHARED(...) shared(__VA_ARGS__)
|
||||
# define LMP_DEFAULT_NONE default(none)
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue