Skip to content

[SYCL][CUDA] Allow to use CUDA backend in all builds #3811

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 2 commits into from
May 26, 2021
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
4 changes: 0 additions & 4 deletions sycl/plugins/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,3 @@ 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)
4 changes: 0 additions & 4 deletions sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ function(add_sycl_rt_library LIB_NAME)
$<$<BOOL:${SYCL_BUILD_PI_CUDA}>:pi_cuda>
)

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

add_common_options(${LIB_NAME} ${LIB_OBJ_NAME})

set_target_properties(${LIB_NAME} PROPERTIES
Expand Down
5 changes: 0 additions & 5 deletions sycl/source/detail/context_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ context_impl::context_impl(const vector_class<cl::sycl::device> Devices,

const auto Backend = getPlugin().getBackend();
if (Backend == backend::cuda) {
#if USE_PI_CUDA
const bool UseCUDAPrimaryContext =
MPropList.has_property<property::context::cuda::use_primary_context>();
const pi_context_properties Props[] = {
Expand All @@ -55,10 +54,6 @@ context_impl::context_impl(const vector_class<cl::sycl::device> Devices,

getPlugin().call<PiApiKind::piContextCreate>(
Props, DeviceIds.size(), DeviceIds.data(), nullptr, nullptr, &MContext);
#else
cl::sycl::detail::pi::die(
"CUDA support was not enabled at compilation time");
#endif
} else {
getPlugin().call<PiApiKind::piContextCreate>(nullptr, DeviceIds.size(),
DeviceIds.data(), nullptr,
Expand Down