Skip to content

Commit b1fa232

Browse files
add support of icpx
1 parent 285fb47 commit b1fa232

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
- name: build-ubuntu-icpc
4646
CXX: icpc
4747
INSTALL_ONEAPI: true
48-
#- name: build-ubuntu-icpx
49-
# CXX: icpx
50-
# INSTALL_ONEAPI: true
48+
- name: build-ubuntu-icpx
49+
CXX: icpx
50+
INSTALL_ONEAPI: true
5151
steps:
5252
- uses: actions/checkout@v2
5353
with:

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ if(Vc_COMPILER_IS_INTEL)
9494
# per default icc is not IEEE compliant, but we need that for verification
9595
AddCompilerFlag("-fp-model source")
9696
endif()
97+
if(Vc_COMPILER_IS_INTEL_LLVM)
98+
# per default icpx is not IEEE compliant, but we need that for verification
99+
AddCompilerFlag("-fno-fast-math")
100+
AddCompilerFlag("-fp-model=precise")
101+
endif()
97102

98103
if(CMAKE_BUILD_TYPE STREQUAL "" AND NOT CMAKE_CXX_FLAGS MATCHES "-O[123]")
99104
message(STATUS "WARNING! It seems you are compiling without optimization. Please set CMAKE_BUILD_TYPE.")

cmake/VcMacros.cmake

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ macro(vc_determine_compiler)
5656
if(Vc_ICC_VERSION VERSION_LESS 18.0.0)
5757
message(FATAL_ERROR "Vc 1.4 requires least ICC 18")
5858
endif()
59+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
60+
set(Vc_COMPILER_IS_INTEL_LLVM true)
61+
message(STATUS "Detected Compiler: IntelLLVM ${CMAKE_CXX_COMPILER_VERSION}")
5962
elseif(CMAKE_CXX_COMPILER MATCHES "(opencc|openCC)$")
6063
set(Vc_COMPILER_IS_OPEN64 true)
6164
message(STATUS "Detected Compiler: Open64")
@@ -316,6 +319,29 @@ int main() { return 0; }
316319
vc_add_compiler_flag(Vc_COMPILE_FLAGS "-diag-disable 2928")
317320
endif()
318321

322+
# Intel doesn't implement the XOP or FMA4 intrinsics
323+
set(Vc_XOP_INTRINSICS_BROKEN true)
324+
set(Vc_FMA4_INTRINSICS_BROKEN true)
325+
elseif(Vc_COMPILER_IS_INTEL_LLVM)
326+
##################################################################################################
327+
# Intel LLVM Compiler #
328+
##################################################################################################
329+
330+
if(_add_buildtype_flags)
331+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
332+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG -O3")
333+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
334+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG -O3")
335+
endif()
336+
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
337+
set(ENABLE_STRICT_ALIASING true CACHE BOOL "Enables strict aliasing rules for more aggressive optimizations")
338+
if(ENABLE_STRICT_ALIASING)
339+
AddCompilerFlag(-ansi-alias CXX_FLAGS Vc_COMPILE_FLAGS)
340+
else()
341+
AddCompilerFlag(-no-ansi-alias CXX_FLAGS Vc_COMPILE_FLAGS)
342+
endif()
343+
endif()
344+
319345
# Intel doesn't implement the XOP or FMA4 intrinsics
320346
set(Vc_XOP_INTRINSICS_BROKEN true)
321347
set(Vc_FMA4_INTRINSICS_BROKEN true)

0 commit comments

Comments
 (0)