Skip to content

Commit ba9a595

Browse files
Set defines to use std::abs and std::sqrt on Linux
We work around issues with these functions when their implementation is taken from VS 2017 headers on Windows though.
1 parent bb52bb1 commit ba9a595

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dpctl/tensor/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,15 @@ set_source_files_properties(
5858
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/linear_sequences.cpp
5959
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/elementwise_functions.cpp
6060
PROPERTIES COMPILE_OPTIONS "${_clang_prefix}-fno-fast-math")
61+
if (UNIX)
62+
set_source_files_properties(
63+
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/elementwise_functions.cpp
64+
PROPERTIES COMPILE_DEFINITIONS "USE_STD_ABS_FOR_COMPLEX_TYPES;USE_STD_SQRT_FOR_COMPLEX_TYPES")
65+
endif()
6166
target_compile_options(${python_module_name} PRIVATE -fno-sycl-id-queries-fit-in-int)
6267
target_link_options(${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel)
6368
if(UNIX)
64-
# this option is support on Linux only
69+
# this option is supported on Linux only
6570
target_link_options(${python_module_name} PRIVATE -fsycl-link-huge-device-code)
6671
endif()
6772
target_include_directories(${python_module_name}

0 commit comments

Comments
 (0)