Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/adapters/level_zero/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventWait(
///< events to wait for completion
) {
for (uint32_t I = 0; I < NumEvents; I++) {
if (EventWaitList[I]->UrQueue->ZeEventsScope == OnDemandHostVisibleProxy) {
auto e = EventWaitList[I];
if (e->UrQueue && e->UrQueue->ZeEventsScope == OnDemandHostVisibleProxy) {
// Make sure to add all host-visible "proxy" event signals if needed.
// This ensures that all signalling commands are submitted below and
// thus proxy events can be waited without a deadlock.
//
ur_event_handle_t_ *Event =
ur_cast<ur_event_handle_t_ *>(EventWaitList[I]);
ur_event_handle_t_ *Event = ur_cast<ur_event_handle_t_ *>(e);
if (!Event->hasExternalRefs())
die("urEventsWait must not be called for an internal event");

Expand Down Expand Up @@ -782,6 +782,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(
Context, UR_EXT_COMMAND_TYPE_USER,
Properties->isNativeHandleOwned);

UREvent->RefCountExternal++;

} catch (const std::bad_alloc &) {
return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
} catch (...) {
Expand Down