commit d2d9e71d2dcdb51fbf05bbb06e316e0db95976e6 Author: eoseret Date: Wed Sep 28 10:28:58 2022 +0200 IntelLLVM compilers support diff --git a/CMake/IntelLLVMCompilers.cmake b/CMake/IntelLLVMCompilers.cmake new file mode 100644 index 0000000..f5e76c1 --- /dev/null +++ b/CMake/IntelLLVMCompilers.cmake @@ -0,0 +1,61 @@ +# Check compiler version +IF ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 21.0 ) +MESSAGE(FATAL_ERROR "Requires Intel 21.0 or higher ") +ENDIF() + +# Enable OpenMP +IF(QMC_OMP) + SET(ENABLE_OPENMP 1) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fiopenmp") +ENDIF(QMC_OMP) + +# Set clang specfic flags (which we always want) +ADD_DEFINITIONS( -Drestrict=__restrict__ ) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer -fstrict-aliasing -D__forceinline=inline") +SET( HAVE_POSIX_MEMALIGN 0 ) # Clang doesn't support -malign-double + +# Set extra optimization specific flags +SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math" ) +SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math" ) + +#------------------------ +# Not on Cray's machine +#------------------------ +IF(NOT $ENV{CRAYPE_VERSION} MATCHES ".") + +SET(X_OPTION "^-x| -x") +SET(AX_OPTION "^-ax| -ax") +#check if the user has already specified -x option for cross-compiling. +if(NOT (CMAKE_CXX_FLAGS MATCHES ${X_OPTION} OR CMAKE_CXX_FLAGS MATCHES ${AX_OPTION})) + #check if -xHost is accepted + CHECK_CXX_COMPILER_FLAG( "-xHost" INTEL_CXX_FLAGS ) + IF(INTEL_CXX_FLAGS) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost") + ENDIF(INTEL_CXX_FLAGS) +endif() #(CMAKE_CXX_FLAGS MATCHES "-x" OR CMAKE_CXX_FLAGS MATCHES "-ax") + +ENDIF(NOT $ENV{CRAYPE_VERSION} MATCHES ".") + +# Add static flags if necessary +IF(QMC_BUILD_STATIC) + SET(CMAKE_CXX_LINK_FLAGS " -static") +ENDIF(QMC_BUILD_STATIC) + +# Coverage +IF (ENABLE_GCOV) + SET(GCOV_COVERAGE TRUE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") +ENDIF(ENABLE_GCOV) + +SET(XRAY_PROFILE FALSE CACHE BOOL "Use llvm xray profiling") +SET(XRAY_INSTRUCTION_THRESHOLD 200 CACHE STRING "Instruction threshold for xray instrumentation") + +IF(XRAY_PROFILE) + set(XRAY_FLAGS "-fxray-instrument -fxray-instruction-threshold=${XRAY_INSTRUCTION_THRESHOLD}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XRAY_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XRAY_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${XRAY_FLAGS}") +ENDIF(XRAY_PROFILE) diff --git a/CMakeLists.txt b/CMakeLists.txt index cec2a7b..931d2b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,6 +219,8 @@ ELSE(CMAKE_TOOLCHAIN_FILE) SET( COMPILER GNU ) ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "XL" ) SET( COMPILER IBM ) + ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "LLVM" ) + SET( COMPILER IntelLLVM ) ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "Intel" ) SET( COMPILER Intel ) ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "PGI" ) @@ -242,6 +244,8 @@ ELSE(CMAKE_TOOLCHAIN_FILE) #------------------------------------ IF( ${COMPILER} MATCHES "IBM" ) INCLUDE(${PROJECT_CMAKE}/IBMCompilers.cmake) + ELSEIF( ${COMPILER} MATCHES "IntelLLVM" ) + INCLUDE(${PROJECT_CMAKE}/IntelLLVMCompilers.cmake) ELSEIF( ${COMPILER} MATCHES "Intel" ) INCLUDE(${PROJECT_CMAKE}/IntelCompilers.cmake) ELSEIF( ${COMPILER} MATCHES "GNU" ) diff --git a/src/Numerics/Spline2/MultiBspline.hpp b/src/Numerics/Spline2/MultiBspline.hpp index d687d2f..62b4c5b 100644 --- a/src/Numerics/Spline2/MultiBspline.hpp +++ b/src/Numerics/Spline2/MultiBspline.hpp @@ -120,7 +120,7 @@ evaluate_vgl(const typename bspline_traits::SplineType* restrict spline_m, const T* restrict coefs3zs = coefs + 3 * zs; ASSUME_ALIGNED(coefs3zs); -#pragma noprefetch + //#pragma noprefetch #pragma omp simd for (int n = 0; n < num_splines; n++) {