Skip to content

Commit 49ea4fa

Browse files
committed
Revert link of rng device example with onemath target
1 parent e751460 commit 49ea4fa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/rng/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
# Note: compile-time example uses both MKLCPU and CURAND backends, therefore
2121
# cmake in the sub-directory will only build it if CURAND backend is enabled
2222
add_subdirectory(compile_time_dispatching)
23+
add_subdirectory(device)
2324

2425
# runtime compilation is only possible with dynamic libraries
25-
# device API is also using the runtime dispatching
2626
if (BUILD_SHARED_LIBS)
27-
add_subdirectory(device)
2827
add_subdirectory(run_time_dispatching)
2928
endif()

examples/rng/device/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,22 @@ set(EXAMPLE_TARGET example_rng_uniform)
4747
# Create a CMake target with one source file
4848
add_executable(${EXAMPLE_TARGET} uniform.cpp)
4949

50-
# Linking against onemath in CMake will add the required include directories and dependencies.
51-
# This target should only be used for runtime dispatching.
52-
target_link_libraries(${EXAMPLE_TARGET} PUBLIC onemath)
53-
5450
# Include directories specific to the examples
51+
# The device example is header only
5552
target_include_directories(${EXAMPLE_TARGET} PUBLIC
5653
${PROJECT_SOURCE_DIR}/examples/rng/device/include
5754
${PROJECT_SOURCE_DIR}/examples/include
55+
${PROJECT_SOURCE_DIR}/include
56+
${PROJECT_SOURCE_DIR}/bin
5857
)
5958

6059
# May be needed to compile source files with SYCL kernels
6160
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
6261
add_sycl_to_target(TARGET ${EXAMPLE_TARGET} SOURCES uniform.cpp)
6362
endif()
6463

64+
target_link_libraries(${EXAMPLE_TARGET} PUBLIC ONEMATH::SYCL::SYCL)
65+
6566
if(NOT ${ONEMATH_SYCL_IMPLEMENTATION} STREQUAL "hipsycl")
6667
# set strict warning flags for rng device API examples
6768
target_compile_options(${EXAMPLE_TARGET} PUBLIC -Wall -Werror -Wextra -Wpedantic -Wunreachable-code -Wfloat-conversion -Wextra-semi -Wshadow)

0 commit comments

Comments
 (0)