Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNG] Added -fsycl -fsycl-device-code-split=per_kernel at the linking stage to have device code #533

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/rng/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ foreach(rng_device_source ${RNG_DEVICE_SOURCES})
ONEMKL::SYCL::SYCL
)

if(is_dpcpp)
target_link_options(example_${domain}_${rng_device_source} PUBLIC -fsycl -fsycl-device-code-split=per_kernel)
endif()

# Register example as ctest
foreach(device_filter ${DEVICE_FILTERS})
add_test(NAME ${domain}/EXAMPLE/DEVICE/${rng_device_source}/${device_filter} COMMAND example_${domain}_${rng_device_source})
Expand Down
10 changes: 7 additions & 3 deletions tests/unit_tests/rng/device/moments/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#===============================================================================

# Build object from all test sources
set(SERVICE_TESTS_SOURCES "moments.cpp")
set(MOMENTS_DEVICE_TESTS_SOURCES "moments.cpp")

add_library(rng_device_moments_ct OBJECT ${SERVICE_TESTS_SOURCES})
add_library(rng_device_moments_ct OBJECT ${MOMENTS_DEVICE_TESTS_SOURCES})
target_compile_options(rng_device_moments_ct PRIVATE -DNOMINMAX)
target_include_directories(rng_device_moments_ct
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include
Expand All @@ -30,7 +30,11 @@ target_include_directories(rng_device_moments_ct
PUBLIC ${CMAKE_BINARY_DIR}/bin
)
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
add_sycl_to_target(TARGET rng_device_moments_ct SOURCES ${SERVICE_TESTS_SOURCES})
add_sycl_to_target(TARGET rng_device_moments_ct SOURCES ${MOMENTS_DEVICE_TESTS_SOURCES})
else()
target_link_libraries(rng_device_moments_ct PUBLIC ONEMKL::SYCL::SYCL)
endif()

if(is_dpcpp)
target_link_options(rng_device_moments_ct PUBLIC -fsycl -fsycl-device-code-split=per_kernel)
endif()
10 changes: 7 additions & 3 deletions tests/unit_tests/rng/device/service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#===============================================================================

# Build object from all test sources
set(SERVICE_TESTS_SOURCES "skip_ahead.cpp")
set(SERVICE_DEVICE_TESTS_SOURCES "skip_ahead.cpp")

add_library(rng_device_service_ct OBJECT ${SERVICE_TESTS_SOURCES})
add_library(rng_device_service_ct OBJECT ${SERVICE_DEVICE_TESTS_SOURCES})
target_compile_options(rng_device_service_ct PRIVATE -DNOMINMAX)
target_include_directories(rng_device_service_ct
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include
Expand All @@ -30,7 +30,11 @@ target_include_directories(rng_device_service_ct
PUBLIC ${CMAKE_BINARY_DIR}/bin
)
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
add_sycl_to_target(TARGET rng_device_service_ct SOURCES ${SERVICE_TESTS_SOURCES})
add_sycl_to_target(TARGET rng_device_service_ct SOURCES ${SERVICE_DEVICE_TESTS_SOURCES})
else()
target_link_libraries(rng_device_service_ct PUBLIC ONEMKL::SYCL::SYCL)
endif()

if(is_dpcpp)
target_link_options(rng_device_service_ct PUBLIC -fsycl -fsycl-device-code-split=per_kernel)
endif()