Skip to content

Commit 78a4c40

Browse files
add support of icpx
1 parent a3b925b commit 78a4c40

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
@@ -42,9 +42,9 @@ jobs:
4242
- name: build-ubuntu-icpc
4343
CXX: icpc
4444
INSTALL_ONEAPI: true
45-
#- name: build-ubuntu-icpx
46-
# CXX: icpx
47-
# INSTALL_ONEAPI: true
45+
- name: build-ubuntu-icpx
46+
CXX: icpx
47+
INSTALL_ONEAPI: true
4848
steps:
4949
- uses: actions/checkout@v2
5050
with:

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ if(Vc_COMPILER_IS_INTEL)
104104
# per default icc is not IEEE compliant, but we need that for verification
105105
AddCompilerFlag("-fp-model source")
106106
endif()
107+
if(Vc_COMPILER_IS_INTEL_LLVM)
108+
# per default icpx is not IEEE compliant, but we need that for verification
109+
#AddCompilerFlag("-fno-fast-math")
110+
AddCompilerFlag("-fp-model=precise")
111+
endif()
107112

108113
if(CMAKE_BUILD_TYPE STREQUAL "" AND NOT CMAKE_CXX_FLAGS MATCHES "-O[123]")
109114
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)