File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 20
20
# Note: compile-time example uses both MKLCPU and CURAND backends, therefore
21
21
# cmake in the sub-directory will only build it if CURAND backend is enabled
22
22
add_subdirectory (compile_time_dispatching)
23
+ add_subdirectory (device)
23
24
24
25
# runtime compilation is only possible with dynamic libraries
25
- # device API is also using the runtime dispatching
26
26
if (BUILD_SHARED_LIBS )
27
- add_subdirectory (device)
28
27
add_subdirectory (run_time_dispatching)
29
28
endif ()
Original file line number Diff line number Diff line change @@ -47,21 +47,22 @@ set(EXAMPLE_TARGET example_rng_uniform)
47
47
# Create a CMake target with one source file
48
48
add_executable (${EXAMPLE_TARGET} uniform.cpp)
49
49
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
-
54
50
# Include directories specific to the examples
51
+ # The device example is header only
55
52
target_include_directories (${EXAMPLE_TARGET} PUBLIC
56
53
${PROJECT_SOURCE_DIR} /examples/rng/device/include
57
54
${PROJECT_SOURCE_DIR} /examples/include
55
+ ${PROJECT_SOURCE_DIR} /include
56
+ ${PROJECT_SOURCE_DIR} /bin
58
57
)
59
58
60
59
# May be needed to compile source files with SYCL kernels
61
60
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
62
61
add_sycl_to_target(TARGET ${EXAMPLE_TARGET} SOURCES uniform.cpp)
63
62
endif ()
64
63
64
+ target_link_libraries (${EXAMPLE_TARGET} PUBLIC ONEMATH::SYCL::SYCL)
65
+
65
66
if (NOT ${ONEMATH_SYCL_IMPLEMENTATION} STREQUAL "hipsycl" )
66
67
# set strict warning flags for rng device API examples
67
68
target_compile_options (${EXAMPLE_TARGET} PUBLIC -Wall -Werror -Wextra -Wpedantic -Wunreachable-code -Wfloat-conversion -Wextra-semi -Wshadow)
You can’t perform that action at this time.
0 commit comments