Skip to content

Commit f62a7b9

Browse files
author
aidan.belton
committed
Specialize make_event for CUDA
1 parent b832840 commit f62a7b9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ inline device make_device<backend::ext_oneapi_cuda>(
7979
return ext::oneapi::cuda::make_device(NativeHandle);
8080
}
8181

82+
// CUDA event specialization
83+
template <>
84+
inline event make_event<backend::ext_oneapi_cuda>(
85+
const backend_input_t<backend::ext_oneapi_cuda, event> &BackendObject,
86+
const context &TargetContext) {
87+
return detail::make_event(detail::pi::cast<pi_native_handle>(BackendObject),
88+
TargetContext, true,
89+
/*Backend*/ backend::ext_oneapi_cuda);
90+
}
91+
8292
// CUDA queue specialization
8393
template <>
8494
inline queue make_queue<backend::ext_oneapi_cuda>(

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3926,7 +3926,7 @@ pi_result cuda_piextEventCreateWithNativeHandle(pi_native_handle nativeHandle,
39263926
bool ownNativeHandle,
39273927
pi_event *event) {
39283928
(void)ownNativeHandle;
3929-
assert(ownNativeHandle == true);
3929+
assert(ownNativeHandle == false);
39303930

39313931
std::unique_ptr<_pi_event> event_ptr{nullptr};
39323932

0 commit comments

Comments
 (0)