Skip to content

Commit

Permalink
[SYCL][CUDA] ext_oneapi_cuda make_device no longer duplicates sycl::d…
Browse files Browse the repository at this point in the history
…evice (#7550)

Fixes #6055 for ext_oneapi_cuda
backend.

Tested with intel/llvm-test-suite#1419.

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
  • Loading branch information
JackAKirk authored Nov 30, 2022
1 parent 28d04a5 commit 75302c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ interop_handle::get_native_context<backend::ext_oneapi_cuda>() const {
template <>
inline device make_device<backend::ext_oneapi_cuda>(
const backend_input_t<backend::ext_oneapi_cuda, device> &BackendObject) {
auto devs = device::get_devices(info::device_type::gpu);
for (auto &dev : devs) {
if (dev.get_backend() == backend::ext_oneapi_cuda &&
BackendObject == get_native<backend::ext_oneapi_cuda>(dev)) {
return dev;
}
}
pi_native_handle NativeHandle = static_cast<pi_native_handle>(BackendObject);
return ext::oneapi::cuda::make_device(NativeHandle);
}
Expand Down

0 comments on commit 75302c5

Please sign in to comment.