Skip to content

Commit

Permalink
Revert link of rng device example with onemath target
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Jan 28, 2025
1 parent e751460 commit 49ea4fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions examples/rng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
# Note: compile-time example uses both MKLCPU and CURAND backends, therefore
# cmake in the sub-directory will only build it if CURAND backend is enabled
add_subdirectory(compile_time_dispatching)
add_subdirectory(device)

# runtime compilation is only possible with dynamic libraries
# device API is also using the runtime dispatching
if (BUILD_SHARED_LIBS)
add_subdirectory(device)
add_subdirectory(run_time_dispatching)
endif()
9 changes: 5 additions & 4 deletions examples/rng/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,22 @@ set(EXAMPLE_TARGET example_rng_uniform)
# Create a CMake target with one source file
add_executable(${EXAMPLE_TARGET} uniform.cpp)

# Linking against onemath in CMake will add the required include directories and dependencies.
# This target should only be used for runtime dispatching.
target_link_libraries(${EXAMPLE_TARGET} PUBLIC onemath)

# Include directories specific to the examples
# The device example is header only
target_include_directories(${EXAMPLE_TARGET} PUBLIC
${PROJECT_SOURCE_DIR}/examples/rng/device/include
${PROJECT_SOURCE_DIR}/examples/include
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/bin
)

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

target_link_libraries(${EXAMPLE_TARGET} PUBLIC ONEMATH::SYCL::SYCL)

if(NOT ${ONEMATH_SYCL_IMPLEMENTATION} STREQUAL "hipsycl")
# set strict warning flags for rng device API examples
target_compile_options(${EXAMPLE_TARGET} PUBLIC -Wall -Werror -Wextra -Wpedantic -Wunreachable-code -Wfloat-conversion -Wextra-semi -Wshadow)
Expand Down

0 comments on commit 49ea4fa

Please sign in to comment.