diff --git a/cmake/Modules/FindDPCPP.cmake b/cmake/Modules/FindDPCPP.cmake index 1687f65b9..de006e90f 100644 --- a/cmake/Modules/FindDPCPP.cmake +++ b/cmake/Modules/FindDPCPP.cmake @@ -96,7 +96,7 @@ function(add_sycl_to_target) "${multi_value_args}" ${ARGN} ) -if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT + if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT (${TUNING_TARGET} STREQUAL "INTEL_GPU") ) target_compile_options(${SB_ADD_SYCL_TARGET} PRIVATE -fno-fast-math) target_compile_options(${SB_ADD_SYCL_TARGET} PRIVATE -mllvm -loopopt=0 ) diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt index f569a6f5b..18d8d8a9b 100644 --- a/test/unittest/CMakeLists.txt +++ b/test/unittest/CMakeLists.txt @@ -102,6 +102,12 @@ if(is_dpcpp) endif() +# Contains tests that fail if compiled with -ffast-math +set(SYCL_UNITTEST_NOFASTMATH + ${PORTBLAS_UNITTEST}/blas1/blas1_rotg_test.cpp + ${PORTBLAS_UNITTEST}/blas1/blas1_rotmg_test.cpp +) + if(GEMM_TALL_SKINNY_SUPPORT) list(APPEND SYCL_UNITTEST_SRCS ${PORTBLAS_UNITTEST}/blas3/blas3_gemm_tall_skinny_test.cpp) endif() @@ -136,8 +142,9 @@ foreach(blas_test ${SYCL_UNITTEST_SRCS}) target_link_libraries(${test_exec} PRIVATE gtest_main Clara::Clara blas::blas portblas) target_include_directories(${test_exec} PRIVATE ${CBLAS_INCLUDE} ${PORTBLAS_COMMON_INCLUDE_DIR}) - if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT - (${TUNING_TARGET} STREQUAL "INTEL_GPU") ) + list (FIND SYCL_UNITTEST_NOFASTMATH ${blas_test} _index) + if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND (( NOT + ${TUNING_TARGET} STREQUAL "INTEL_GPU") OR (${_index} GREATER -1)) ) target_compile_options(${test_exec} PRIVATE "-fno-fast-math") endif()