diff --git a/sycl/source/interop_handle.cpp b/sycl/source/interop_handle.cpp index 2a8b18a74344f..448bf680b6d53 100644 --- a/sycl/source/interop_handle.cpp +++ b/sycl/source/interop_handle.cpp @@ -90,8 +90,11 @@ std::vector interop_handle::getNativeEvents() const { // entry points. We will maybe need a new host task entry point. std::vector RetEvents; for (auto &DepEvent : MEvent->getWaitList()) { - auto NativeEvents = DepEvent->getNativeVector(); - RetEvents.insert(RetEvents.end(), NativeEvents.begin(), NativeEvents.end()); + if (DepEvent->backendSet()) { + auto NativeEvents = DepEvent->getNativeVector(); + RetEvents.insert(RetEvents.end(), NativeEvents.begin(), + NativeEvents.end()); + } } return RetEvents; }