Skip to content

Commit

Permalink
add support of icpx
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Apr 8, 2022
1 parent b5597e5 commit 0e86203
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,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:
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,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.")
Expand Down
26 changes: 26 additions & 0 deletions cmake/VcMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0e86203

Please sign in to comment.