Skip to content

Commit 5322614

Browse files
egrabovskayanormallytangent
authored andcommitted
[RNG] Added -fsycl -fsycl-device-code-split=per_kernel at the linking stage to have device code because of failures on windows (#533)
1 parent 78fac71 commit 5322614

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

cmake/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
install(FILES FindCompiler.cmake
2121
DESTINATION "lib/cmake/${PROJECT_NAME}"
2222
)
23-
2423
if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND)
2524
install(FILES mkl/MKLConfig.cmake
2625
DESTINATION "lib/cmake/${PROJECT_NAME}"

cmake/FindCompiler.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
#===============================================================================
1919

2020
include_guard()
21-
2221
include(CheckCXXCompilerFlag)
2322
include(FindPackageHandleStandardArgs)
24-
2523
check_cxx_compiler_flag("-fsycl" is_dpcpp)
2624

2725
if(is_dpcpp)

examples/rng/device/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ foreach(rng_device_source ${RNG_DEVICE_SOURCES})
5959
ONEMKL::SYCL::SYCL
6060
)
6161

62+
if(NOT ${ONEMKL_SYCL_IMPLEMENTATION} STREQUAL "hipsycl")
63+
target_link_options(example_${domain}_${rng_device_source} PUBLIC -fsycl -fsycl-device-code-split=per_kernel)
64+
endif()
65+
6266
# Register example as ctest
6367
foreach(device_filter ${DEVICE_FILTERS})
6468
add_test(NAME ${domain}/EXAMPLE/DEVICE/${rng_device_source}/${device_filter} COMMAND example_${domain}_${rng_device_source})

tests/unit_tests/rng/device/moments/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
#===============================================================================
1919

2020
# Build object from all test sources
21-
set(SERVICE_TESTS_SOURCES "moments.cpp")
21+
set(MOMENTS_DEVICE_TESTS_SOURCES "moments.cpp")
2222

23-
add_library(rng_device_moments_ct OBJECT ${SERVICE_TESTS_SOURCES})
23+
add_library(rng_device_moments_ct OBJECT ${MOMENTS_DEVICE_TESTS_SOURCES})
2424
target_compile_options(rng_device_moments_ct PRIVATE -DNOMINMAX)
2525
target_include_directories(rng_device_moments_ct
2626
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include
@@ -30,7 +30,11 @@ target_include_directories(rng_device_moments_ct
3030
PUBLIC ${CMAKE_BINARY_DIR}/bin
3131
)
3232
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
33-
add_sycl_to_target(TARGET rng_device_moments_ct SOURCES ${SERVICE_TESTS_SOURCES})
33+
add_sycl_to_target(TARGET rng_device_moments_ct SOURCES ${MOMENTS_DEVICE_TESTS_SOURCES})
3434
else()
3535
target_link_libraries(rng_device_moments_ct PUBLIC ONEMKL::SYCL::SYCL)
3636
endif()
37+
38+
if(NOT ${ONEMKL_SYCL_IMPLEMENTATION} STREQUAL "hipsycl")
39+
target_link_options(rng_device_moments_ct PUBLIC -fsycl -fsycl-device-code-split=per_kernel)
40+
endif()

tests/unit_tests/rng/device/service/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
#===============================================================================
1919

2020
# Build object from all test sources
21-
set(SERVICE_TESTS_SOURCES "skip_ahead.cpp")
21+
set(SERVICE_DEVICE_TESTS_SOURCES "skip_ahead.cpp")
2222

23-
add_library(rng_device_service_ct OBJECT ${SERVICE_TESTS_SOURCES})
23+
add_library(rng_device_service_ct OBJECT ${SERVICE_DEVICE_TESTS_SOURCES})
2424
target_compile_options(rng_device_service_ct PRIVATE -DNOMINMAX)
2525
target_include_directories(rng_device_service_ct
2626
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include
@@ -30,7 +30,11 @@ target_include_directories(rng_device_service_ct
3030
PUBLIC ${CMAKE_BINARY_DIR}/bin
3131
)
3232
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
33-
add_sycl_to_target(TARGET rng_device_service_ct SOURCES ${SERVICE_TESTS_SOURCES})
33+
add_sycl_to_target(TARGET rng_device_service_ct SOURCES ${SERVICE_DEVICE_TESTS_SOURCES})
3434
else()
3535
target_link_libraries(rng_device_service_ct PUBLIC ONEMKL::SYCL::SYCL)
3636
endif()
37+
38+
if(NOT ${ONEMKL_SYCL_IMPLEMENTATION} STREQUAL "hipsycl")
39+
target_link_options(rng_device_service_ct PUBLIC -fsycl -fsycl-device-code-split=per_kernel)
40+
endif()

0 commit comments

Comments
 (0)