diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 96569404e..f7e4c5f39 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,9 +45,9 @@ jobs: - name: build-ubuntu-icpc CXX: icpc INSTALL_ONEAPI: true - #- name: build-ubuntu-icpx - # CXX: icpx - # INSTALL_ONEAPI: true + - name: build-ubuntu-icpx + CXX: icpx + INSTALL_ONEAPI: true steps: - uses: actions/checkout@v2 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index d629ebbde..71e44872e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,11 @@ if(Vc_COMPILER_IS_INTEL) # per default icc is not IEEE compliant, but we need that for verification AddCompilerFlag("-fp-model source") endif() +if(Vc_COMPILER_IS_INTEL_LLVM) + # per default icpx is not IEEE compliant, but we need that for verification + AddCompilerFlag("-fno-fast-math") + AddCompilerFlag("-fp-model=precise") +endif() if(CMAKE_BUILD_TYPE STREQUAL "" AND NOT CMAKE_CXX_FLAGS MATCHES "-O[123]") message(STATUS "WARNING! It seems you are compiling without optimization. Please set CMAKE_BUILD_TYPE.") diff --git a/cmake/VcMacros.cmake b/cmake/VcMacros.cmake index 478ba8716..9435f3930 100644 --- a/cmake/VcMacros.cmake +++ b/cmake/VcMacros.cmake @@ -56,6 +56,9 @@ macro(vc_determine_compiler) if(Vc_ICC_VERSION VERSION_LESS 18.0.0) message(FATAL_ERROR "Vc 1.4 requires least ICC 18") endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") + set(Vc_COMPILER_IS_INTEL_LLVM true) + message(STATUS "Detected Compiler: IntelLLVM ${CMAKE_CXX_COMPILER_VERSION}") elseif(CMAKE_CXX_COMPILER MATCHES "(opencc|openCC)$") set(Vc_COMPILER_IS_OPEN64 true) message(STATUS "Detected Compiler: Open64") @@ -316,6 +319,29 @@ int main() { return 0; } vc_add_compiler_flag(Vc_COMPILE_FLAGS "-diag-disable 2928") endif() + # Intel doesn't implement the XOP or FMA4 intrinsics + set(Vc_XOP_INTRINSICS_BROKEN true) + set(Vc_FMA4_INTRINSICS_BROKEN true) + elseif(Vc_COMPILER_IS_INTEL_LLVM) + ################################################################################################## + # Intel LLVM Compiler # + ################################################################################################## + + if(_add_buildtype_flags) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG -O3") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG -O3") + endif() + if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + set(ENABLE_STRICT_ALIASING true CACHE BOOL "Enables strict aliasing rules for more aggressive optimizations") + if(ENABLE_STRICT_ALIASING) + AddCompilerFlag(-ansi-alias CXX_FLAGS Vc_COMPILE_FLAGS) + else() + AddCompilerFlag(-no-ansi-alias CXX_FLAGS Vc_COMPILE_FLAGS) + endif() + endif() + # Intel doesn't implement the XOP or FMA4 intrinsics set(Vc_XOP_INTRINSICS_BROKEN true) set(Vc_FMA4_INTRINSICS_BROKEN true)