Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Disable -ffast-math for IntelLLVM compilers
Browse files Browse the repository at this point in the history
This breaks essentially all floating point tests. With this I can run the whole test suite fine with ICC-2023.0.0
  • Loading branch information
miscco committed Mar 23, 2023
1 parent 72341e7 commit 2472a5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .upstream-tests/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ if (NOT MSVC)
--compiler-options=-Wextra")
endif()

# Intel OneAPI compiler has fast math enabled by default which breaks almost all floating point tests
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM")
set(LIBCUDACXX_TEST_COMPILER_FLAGS
"${LIBCUDACXX_TEST_COMPILER_FLAGS} \
--compiler-options=-fno-fast-math")
endif()

if (${CMAKE_CUDA_COMPILER_ID} STREQUAL "NVIDIA")
set(LIBCUDACXX_TEST_COMPILER_FLAGS
"${LIBCUDACXX_TEST_COMPILER_FLAGS} \
Expand Down
3 changes: 3 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ function(cxx_add_warning_flags target)
-Wno-literal-suffix
-Wno-c++14-compat
-Wno-noexcept-type)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
target_add_compile_flags_if_supported(${target} PRIVATE
-fno-fast-math)
endif()
if (LIBCXX_ENABLE_WERROR)
target_add_compile_flags_if_supported(${target} PRIVATE -Werror)
Expand Down

0 comments on commit 2472a5f

Please sign in to comment.