Skip to content

[SYCL][CUDA] Fix CMake warning #1301

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

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 10 additions & 9 deletions sycl/plugins/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,22 @@ add_dependencies(sycl-toolchain pi_cuda)

set_target_properties(pi_cuda PROPERTIES LINKER_LANGUAGE CXX)

target_include_directories(pi_cuda PRIVATE "${sycl_inc_dir}")

target_include_directories(pi_cuda INTERFACE ${CUDA_INCLUDE_DIRS})
target_include_directories(pi_cuda
PRIVATE
${sycl_inc_dir}
PUBLIC
${CUDA_INCLUDE_DIRS}
)

target_link_libraries(pi_cuda PUBLIC OpenCL-Headers cudadrv)

target_link_libraries(sycl INTERFACE pi_cuda)

add_common_options(pi_cuda)

target_compile_definitions(
sycl PUBLIC USE_PI_CUDA
)

install(TARGETS pi_cuda
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT pi_cuda
RUNTIME DESTINATION "bin" COMPONENT pi_cuda
)

# `sycl/source/CMakeLists.txt` adapted when SYCL_BUILD_PI_CUDA is defined:
# target_link_libraries(sycl PUBLIC pi_cuda)
# target_compile_definitions(sycl PUBLIC USE_PI_CUDA)
13 changes: 10 additions & 3 deletions sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ function(add_sycl_rt_library LIB_NAME)
target_include_directories(
${LIB_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} "${sycl_inc_dir}")
target_link_libraries(${LIB_NAME}
PRIVATE OpenCL::Headers
PRIVATE ${OpenCL_LIBRARIES}
PRIVATE ${CMAKE_DL_LIBS}
PRIVATE
OpenCL::Headers
${OpenCL_LIBRARIES}
${CMAKE_DL_LIBS}
PUBLIC
$<$<BOOL:${SYCL_BUILD_PI_CUDA}>:pi_cuda>
)

target_compile_definitions(${LIB_NAME}
PUBLIC
$<$<BOOL:${SYCL_BUILD_PI_CUDA}>:USE_PI_CUDA>)

add_common_options(${LIB_NAME})

endfunction(add_sycl_rt_library)
Expand Down