Skip to content

Commit 071960f

Browse files
author
Alexander Batashev
authored
[SYCL][CUDA] Fix incorrectly dispatched PI methods (#2726)
1 parent 766367b commit 071960f

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4529,8 +4529,9 @@ pi_result piPluginInit(pi_plugin *PluginInit) {
45294529
_PI_CL(piProgramGetBuildInfo, cuda_piProgramGetBuildInfo)
45304530
_PI_CL(piProgramRetain, cuda_piProgramRetain)
45314531
_PI_CL(piProgramRelease, cuda_piProgramRelease)
4532-
_PI_CL(piextMemGetNativeHandle, cuda_piextMemGetNativeHandle)
4533-
_PI_CL(piextMemCreateWithNativeHandle, cuda_piextMemCreateWithNativeHandle)
4532+
_PI_CL(piextProgramGetNativeHandle, cuda_piextProgramGetNativeHandle)
4533+
_PI_CL(piextProgramCreateWithNativeHandle,
4534+
cuda_piextProgramCreateWithNativeHandle)
45344535
// Kernel
45354536
_PI_CL(piKernelCreate, cuda_piKernelCreate)
45364537
_PI_CL(piKernelSetArg, cuda_piKernelSetArg)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
3+
// REQUIRES: cuda
4+
5+
#include <CL/sycl.hpp>
6+
#include <CL/sycl/backend/cuda.hpp>
7+
8+
int main() {
9+
sycl::queue Queue{sycl::default_selector{}};
10+
Queue.submit(
11+
[](sycl::handler &CGH) { CGH.single_task<class TestKernel>([] {}); });
12+
13+
sycl::program Prog{Queue.get_context()};
14+
Prog.build_with_kernel_type<class TestKernel>();
15+
16+
auto NativeProgram = Prog.get_native<sycl::backend::cuda>();
17+
18+
assert(NativeProgram != 0);
19+
20+
// TODO check program interop constructor, once it is available.
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)