Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
Make sure that the size of the vector of native events returned
by get_native_events is greater than zero.
  • Loading branch information
hdelan committed Feb 23, 2024
1 parent a2afad6 commit 7def376
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ template <typename WaitOnType> void test2() {
cgh.depends_on(syclEvent1);
cgh.host_task([&](sycl::interop_handle ih) {
cudaSetCtxAndGetStreamAndEvent(ih);
for (auto &cudaEv :
ih.get_native_events<sycl::backend::ext_oneapi_cuda>())
auto nativeEvents =
ih.get_native_events<sycl::backend::ext_oneapi_cuda>();
assert(nativeEvents.size());
for (auto &cudaEv : nativeEvents) {
CUDA_CHECK(cuEventSynchronize(cudaEv));
}
});
});

Expand Down Expand Up @@ -112,9 +115,12 @@ template <typename WaitOnType> void test3() {
cgh.depends_on(syclEvent1);
cgh.host_task([&](sycl::interop_handle ih) {
auto [stream, _] = cudaSetCtxAndGetStreamAndEvent(ih);
for (auto &cudaEv :
ih.get_native_events<sycl::backend::ext_oneapi_cuda>())
auto nativeEvents =
ih.get_native_events<sycl::backend::ext_oneapi_cuda>();
assert(nativeEvents.size());
for (auto &cudaEv : nativeEvents) {
CUDA_CHECK(cuStreamWaitEvent(stream, cudaEv, 0));
}

CUDA_CHECK(cuMemcpyDtoHAsync(ptrHostB,
reinterpret_cast<CUdeviceptr>(ptrDevice),
Expand Down

0 comments on commit 7def376

Please sign in to comment.