Skip to content

Commit

Permalink
Add compilation flags to increase icpx support
Browse files Browse the repository at this point in the history
  • Loading branch information
s-Nick committed Apr 11, 2024
1 parent 11e8b0b commit 37a8bab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ 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) )
target_compile_options(portblas INTERFACE -fno-fast-math)
target_compile_options(portblas INTERFACE -mllvm -loopopt=0 )
endif()
else()
add_subdirectory(src)
build_library(portblas ${BLAS_ENABLE_EXTENSIONS})
Expand Down
6 changes: 6 additions & 0 deletions cmake/Modules/FindDPCPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ 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 @@ -96,6 +97,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) )
target_compile_options(${SB_ADD_SYCL_TARGET} PRIVATE -fno-fast-math)
target_compile_options(${SB_ADD_SYCL_TARGET} PRIVATE -mllvm -loopopt=0 )
endif()
target_compile_options(${SB_ADD_SYCL_TARGET} PUBLIC ${DPCPP_FLAGS})
get_target_property(target_type ${SB_ADD_SYCL_TARGET} TYPE)
if (NOT target_type STREQUAL "OBJECT_LIBRARY")
Expand Down

0 comments on commit 37a8bab

Please sign in to comment.