Skip to content
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

sycl::devices created via interop API are not uniqued #6055

Open
Ralender opened this issue Apr 25, 2022 · 7 comments · Fixed by #7550
Open

sycl::devices created via interop API are not uniqued #6055

Ralender opened this issue Apr 25, 2022 · 7 comments · Fixed by #7550
Labels
bug Something isn't working runtime Runtime library related issue

Comments

@Ralender
Copy link
Contributor

Ralender commented Apr 25, 2022

Describe the bug
If a device is created via the interop API it will always create a new device_impl even when there already y exist a device_impl with the same backend handle. this issue is not limited to opencl or any device in particular.

To Reproduce
create a file named test.cpp containing

#include <sycl/sycl.hpp>

int main() {
  sycl::device sdev(sycl::default_selector{});
  auto ocl_dev = sycl::get_native<sycl::backend::opencl>(sdev);
  sycl::device dev(sycl::make_device<sycl::backend::opencl>(ocl_dev));
  assert(sdev == dev);
}

clang++ -fsycl -o a.out test_interop_opencl.cpp

clang++ being the sycl capable compiler

./a.out

this will hit the assert even thought (in my case the opencl implementation returned the same device handle)

Environment (please complete the following information):

  • OS: Any
  • Target device and vendor: Any
  • DPC++ version: e25f199
@Ralender Ralender added the bug Something isn't working label Apr 25, 2022
@AerialMantis AerialMantis added cuda CUDA back-end runtime Runtime library related issue labels May 23, 2022
@JackAKirk
Copy link
Contributor

Fix proposed here: #6204

@keryell
Copy link
Contributor

keryell commented Dec 2, 2022

Thanks!

@JackAKirk JackAKirk removed the cuda CUDA back-end label Jul 25, 2023
@JackAKirk
Copy link
Contributor

Reopened this since the fix was only for the cuda backend and opencl behavior is unchanged from the originally reported issue.

@AlexeySachkov
Copy link
Contributor

I think that this is fixed by #13483. Tagging @aelovikov-intel to comment here

@aelovikov-intel
Copy link
Contributor

I think that this is fixed by #13483. Tagging @aelovikov-intel to comment here

I believe I couldn't fix it for OpenCL because there is CPU backend where the number of all potential (sub-)sub-devices is exponential.

@AlexeySachkov
Copy link
Contributor

I think that this is fixed by #13483. Tagging @aelovikov-intel to comment here

I believe I couldn't fix it for OpenCL because there is CPU backend where the number of all potential (sub-)sub-devices is exponential.

Ok, but it is at least fixed for top-level devices as illustrated by a test you added, right?

@aelovikov-intel
Copy link
Contributor

Ok, but it is at least fixed for top-level devices as illustrated by a test you added, right?

Can't say that I remember, but it definitely looks so based on the changes in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime Runtime library related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants