From 0fa81c93c6fab44cc7ffac21cdbc06907f46bf5e Mon Sep 17 00:00:00 2001 From: nscipione Date: Tue, 16 Apr 2024 13:51:35 +0100 Subject: [PATCH] Reverting changes in test cmake for icpx compatibility Removing -fno-fast-math from rotmg and rotg tests compilation causes them to fail. --- cmake/Modules/FindDPCPP.cmake | 2 +- test/unittest/CMakeLists.txt | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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()