Skip to content

Commit

Permalink
Turn off fast math for Catch2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
j-stephan committed Sep 5, 2023
1 parent 1f332be commit 8bcee69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/common/devCompileOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Inte

if(${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM")
# fast math is turned on by default with ICPX, which breaks our unit tests
list(APPEND alpaka_DEV_COMPILE_OPTIONS "-ffp-model=precise")
list(APPEND alpaka_DEV_COMPILE_OPTIONS "-fp-model=precise")

if (alpaka_ACC_SYCL_ENABLE)
# avoid: warning: disabled expansion of recursive macro
Expand Down
3 changes: 3 additions & 0 deletions thirdParty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ if(BUILD_TESTING)
# Remarks are not treated as warnings so we need to disable them manually.
add_compile_options($<$<AND:$<CONFIG:Debug>,$<CXX_COMPILER_ID:IntelLLVM>>:-Rno-debug-disables-optimization>)

# Turn off fast math to prevent warnings inside Catch2 (icpx defaults to -fp-model=fast)
add_compile_options($<$<CXX_COMPILER_ID:IntelLLVM>:-fp-model=precise>)

add_subdirectory(catch2)

# hide Catch2 cmake variables by default in cmake gui
Expand Down

0 comments on commit 8bcee69

Please sign in to comment.