From 29b5fce5e4670dd001ea3f4284c5294a6c8f63d1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2025 21:20:44 -0500 Subject: [PATCH] do not define __INTEL_COMPILER to __INTEL_LLVM_COMPILER instead test for either This shortcut will create problems for features that do not exist for the Intel LLVM based compiler. --- src/INTEL/fix_intel.cpp | 6 +++--- src/INTEL/intel_intrinsics_airebo.h | 2 +- src/INTEL/intel_preprocess.h | 5 ++--- src/INTEL/npair_intel.cpp | 8 ++++---- src/INTEL/pair_sw_intel.cpp | 3 +-- src/INTEL/pair_tersoff_intel.cpp | 2 +- src/INTEL/pair_tersoff_intel.h | 4 ++-- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 150d3913bc..7e82d3a63b 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -210,7 +210,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // nomp is user setting, default = 0 #if defined(_OPENMP) - #if defined(__INTEL_COMPILER) + #if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) kmp_set_blocktime(0); #endif if (nomp != 0) { @@ -449,8 +449,8 @@ void FixIntel::pair_init_check(const bool cdmessage) __INTEL_COMPILER_BUILD_DATE < 20141023) error->warning(FLERR,"Unsupported Intel Compiler."); #endif - #if !defined(__INTEL_COMPILER) - error->warning(FLERR,"Unsupported Intel Compiler."); + #if !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER) + error->warning(FLERR,"Unsupported Intel Compiler."); #endif } diff --git a/src/INTEL/intel_intrinsics_airebo.h b/src/INTEL/intel_intrinsics_airebo.h index 41b147ae3c..298dc45360 100644 --- a/src/INTEL/intel_intrinsics_airebo.h +++ b/src/INTEL/intel_intrinsics_airebo.h @@ -1,6 +1,6 @@ // clang-format off #ifndef LMP_INTEL_AIREBO_SCALAR -# ifdef __INTEL_COMPILER +# if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) # if defined(__MIC__) || defined(__AVX512F__) # define LMP_INTEL_AIREBO_512 # elif defined(__AVX__) diff --git a/src/INTEL/intel_preprocess.h b/src/INTEL/intel_preprocess.h index 2c4b9a0c1b..50d0cd6b5d 100644 --- a/src/INTEL/intel_preprocess.h +++ b/src/INTEL/intel_preprocess.h @@ -20,7 +20,6 @@ #ifdef __INTEL_LLVM_COMPILER #define USE_OMP_SIMD -#define __INTEL_COMPILER __INTEL_LLVM_COMPILER #define __INTEL_COMPILER_BUILD_DATE __INTEL_LLVM_COMPILER // Indicate to vectorizer that it is safe to use dword indexed gather #define IP_PRE_dword_index(i) ((i) & NEIGHMASK) @@ -28,7 +27,7 @@ #define IP_PRE_dword_index(i) i #endif -#ifdef __INTEL_COMPILER +#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) #define LMP_SIMD_COMPILER #if (__INTEL_COMPILER_BUILD_DATE > 20160720) #define LMP_INTEL_USE_SIMDOFF @@ -87,7 +86,7 @@ enum {TIME_PACK, TIME_HOST_NEIGHBOR, TIME_HOST_PAIR, TIME_OFFLOAD_NEIGHBOR, #define INTEL_P3M_MAXORDER 8 #define INTEL_P3M_ALIGNED_MAXORDER 8 -#ifdef __INTEL_COMPILER +#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) #ifdef __AVX__ #undef INTEL_VECTOR_WIDTH #define INTEL_VECTOR_WIDTH 8 diff --git a/src/INTEL/npair_intel.cpp b/src/INTEL/npair_intel.cpp index dcfb66e05f..9929fb9a21 100644 --- a/src/INTEL/npair_intel.cpp +++ b/src/INTEL/npair_intel.cpp @@ -777,14 +777,14 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, int * _noalias jlist = firstneigh[i]; int jnum = numneigh[i]; if (!THREE) IP_PRE_neighbor_pad(jnum, offload); - #if __INTEL_COMPILER+0 > 1499 -#if defined(USE_OMP_SIMD) + #if (__INTEL_COMPILER+0 > 1499) || __INTEL_LLVM_COMPILER + #if defined(USE_OMP_SIMD) #pragma omp simd reduction(max:vlmax,vgmax) \ reduction(min:vlmin, vgmin) -#else + #else #pragma simd reduction(max:vlmax,vgmax) \ reduction(min:vlmin, vgmin) -#endif + #endif #pragma vector aligned #endif for (int jj = 0; jj < jnum; jj++) { diff --git a/src/INTEL/pair_sw_intel.cpp b/src/INTEL/pair_sw_intel.cpp index 35a091aef2..fcc9e6b700 100644 --- a/src/INTEL/pair_sw_intel.cpp +++ b/src/INTEL/pair_sw_intel.cpp @@ -1131,8 +1131,7 @@ void PairSWIntel::init_style() #if defined(__INTEL_COMPILER) if (__INTEL_COMPILER_BUILD_DATE < 20141023) - error->all(FLERR, "Intel compiler versions before " - "15 Update 1 not supported for sw/intel"); + error->all(FLERR, "Intel compiler versions before 15 Update 1 not supported for sw/intel"); #endif } diff --git a/src/INTEL/pair_tersoff_intel.cpp b/src/INTEL/pair_tersoff_intel.cpp index 758eca21ec..67e1d981f4 100644 --- a/src/INTEL/pair_tersoff_intel.cpp +++ b/src/INTEL/pair_tersoff_intel.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; // Currently the Intel compiler is required for this pair style. -#ifdef __INTEL_COMPILER +#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) #ifdef _LMP_INTEL_OFFLOAD #pragma offload_attribute(push,target(mic)) diff --git a/src/INTEL/pair_tersoff_intel.h b/src/INTEL/pair_tersoff_intel.h index abbca51809..cffc32d02a 100644 --- a/src/INTEL/pair_tersoff_intel.h +++ b/src/INTEL/pair_tersoff_intel.h @@ -15,7 +15,7 @@ #ifdef PAIR_CLASS // clang-format off // Currently the Intel compilers are required for this pair style. -#ifdef __INTEL_COMPILER +#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) PairStyle(tersoff/intel,PairTersoffIntel); #endif // clang-format on @@ -28,7 +28,7 @@ PairStyle(tersoff/intel,PairTersoffIntel); #include "pair.h" #include "pair_tersoff.h" -#ifdef __INTEL_COMPILER +#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) namespace LAMMPS_NS {