-
Notifications
You must be signed in to change notification settings - Fork 798
Labels
bugSomething isn't workingSomething isn't workingcompilerCompiler related issueCompiler related issuehipIssues related to execution on HIP backend.Issues related to execution on HIP backend.
Description
get_native()
doesn't work for device when CUDA or HIP backend is used.
Reproducer:
#include <sycl/sycl.hpp>
int main() {
auto dev = sycl::device(sycl::gpu_selector{});
auto ctx = sycl::context(dev);
auto cuda_ctx = sycl::get_native<sycl::backend::ext_oneapi_cuda>(ctx);
auto cuda_dev = sycl::get_native<sycl::backend::ext_oneapi_cuda>(dev);
return 0;
}
Error message:
In file included from /buildspace/dpcpp/llvm/build/install/bin/../include/sycl/sycl.hpp:16:
/buildspace/dpcpp/llvm/build/install/bin/../include/sycl/backend.hpp:128:10: error: reinterpret_cast from 'pi_native_handle' (aka 'unsigned long') to 'backend_return_t<(backend)'\x03', device>' (aka 'int') is not allowed
return reinterpret_cast<backend_return_t<BackendName, SyclObjectT>>(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.cpp:8:31: note: in instantiation of function template specialization 'sycl::get_native<sycl::backend::ext_oneapi_cuda, sycl::device>' requested here
auto cuda_dev = sycl::get_native<sycl::backend::ext_oneapi_cuda>(dev);
^
1 error generated.
I tried DPC++ daily 2022-08-22 and oneAPI DPC++ Compiler 2022-06, the result is same.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompilerCompiler related issueCompiler related issuehipIssues related to execution on HIP backend.Issues related to execution on HIP backend.