Skip to content

Commit 36fbb6e

Browse files
author
Hugh Delaney
committed
Fix test
1 parent 115ed23 commit 36fbb6e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sycl/include/sycl/backend.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ get_native<backend::ext_oneapi_cuda, device>(const device &Obj) {
214214
Obj.getNative());
215215
}
216216

217+
#ifndef SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL
217218
template <>
218219
__SYCL_DEPRECATED(
219220
"Context interop is deprecated for CUDA. If a native context is required,"
@@ -246,6 +247,7 @@ inline backend_return_t<backend::ext_oneapi_cuda, context> interop_handle::
246247
#endif // __SYCL_DEVICE_ONLY__
247248
}
248249

250+
#endif // SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL
249251
#endif // SYCL_EXT_ONEAPI_BACKEND_CUDA
250252

251253
#if SYCL_EXT_ONEAPI_BACKEND_HIP

sycl/test/basic_tests/interop-cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
/// Also test the experimental CUDA interop interface
66
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %s
77
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %s
8-
// expected-no-diagnostics
98

109
// Test for legacy and experimental CUDA interop API
1110

@@ -59,6 +58,7 @@ int main() {
5958
// backend-defined and specified in the backend specification.
6059

6160
cu_device = get_native<backend::ext_oneapi_cuda>(Device);
61+
// expected-warning@+1{{'get_native<sycl::backend::ext_oneapi_cuda, sycl::context>' is deprecated: Context interop is deprecated for CUDA. If a native context is required, use cuDevicePrimaryCtxRetain with a native device}}
6262
cu_context = get_native<backend::ext_oneapi_cuda>(Context);
6363
cu_event = get_native<backend::ext_oneapi_cuda>(Event);
6464
cu_queue = get_native<backend::ext_oneapi_cuda>(Queue);

0 commit comments

Comments
 (0)