Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
Inverting device check before adding extra compiler flags to increase
compatibility. Removing useless flags in test.
  • Loading branch information
s-Nick committed Apr 16, 2024
1 parent 33bda6b commit 5749c0b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ if (INSTALL_HEADER_ONLY)
set_target_properties(portblas PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE};$<INSTALL_INTERFACE:src>"
)
set(non_intel_target "AMD_GPU" "NVIDIA_GPU")
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND
(TUNING_TARGET IN_LIST non_intel_target) )
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT
(${TUNING_TARGET} STREQUAL "INTEL_GPU") )
target_compile_options(portblas INTERFACE -fno-fast-math)
target_compile_options(portblas INTERFACE -mllvm -loopopt=0 )
endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake/Modules/FindDPCPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ endif()
add_definitions(-DSB_ENABLE_USM=1)
set(SB_ENABLE_USM 1)
list(APPEND DPCPP_FLAGS "-DSB_ENABLE_USM=1")
set(non_intel_target "AMD_GPU" "NVIDIA_GPU")

function(add_sycl_to_target)
set(options)
Expand All @@ -97,10 +96,11 @@ function(add_sycl_to_target)
"${multi_value_args}"
${ARGN}
)
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND
(TUNING_TARGET IN_LIST non_intel_target) )
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 )
message(STATUS "Adding -fno-fast-math -mllvm -loopopt=0 to target ${SB_ADD_SYCL_TARGET}")
endif()
target_compile_options(${SB_ADD_SYCL_TARGET} PUBLIC ${DPCPP_FLAGS})
get_target_property(target_type ${SB_ADD_SYCL_TARGET} TYPE)
Expand Down
2 changes: 1 addition & 1 deletion src/operations/blas1_trees.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ PORTBLAS_INLINE bool TupleOp<rhs_t>::valid_thread(
template <typename rhs_t>
PORTBLAS_INLINE typename TupleOp<rhs_t>::value_t TupleOp<rhs_t>::eval(
typename TupleOp<rhs_t>::index_t i) {
return TupleOp<rhs_t>::value_t(i, cl::sycl::abs(rhs_.eval(i)));
return TupleOp<rhs_t>::value_t(i, cl::sycl::fabs(rhs_.eval(i)));
}

template <typename rhs_t>
Expand Down
11 changes: 2 additions & 9 deletions test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ 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()
Expand Down Expand Up @@ -142,9 +136,8 @@ 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})

list (FIND SYCL_UNITTEST_NOFASTMATH ${blas_test} _index)
if (${_index} GREATER -1 OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM" AND
TUNING_TARGET IN_LIST non_intel_target))
if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT
(${TUNING_TARGET} STREQUAL "INTEL_GPU") )
target_compile_options(${test_exec} PRIVATE "-fno-fast-math")
endif()

Expand Down

0 comments on commit 5749c0b

Please sign in to comment.