Skip to content

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

Open
@Ralender

Description

@Ralender

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruntimeRuntime library related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions