File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -625,13 +625,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventWait(
625625 // /< events to wait for completion
626626) {
627627 for (uint32_t I = 0 ; I < NumEvents; I++) {
628- if (EventWaitList[I]->UrQueue ->ZeEventsScope == OnDemandHostVisibleProxy) {
628+ auto e = EventWaitList[I];
629+ if (e->UrQueue && e->UrQueue ->ZeEventsScope == OnDemandHostVisibleProxy) {
629630 // Make sure to add all host-visible "proxy" event signals if needed.
630631 // This ensures that all signalling commands are submitted below and
631632 // thus proxy events can be waited without a deadlock.
632633 //
633- ur_event_handle_t_ *Event =
634- ur_cast<ur_event_handle_t_ *>(EventWaitList[I]);
634+ ur_event_handle_t_ *Event = ur_cast<ur_event_handle_t_ *>(e);
635635 if (!Event->hasExternalRefs ())
636636 die (" urEventsWait must not be called for an internal event" );
637637
@@ -782,6 +782,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(
782782 Context, UR_EXT_COMMAND_TYPE_USER,
783783 Properties->isNativeHandleOwned );
784784
785+ UREvent->RefCountExternal ++;
786+
785787 } catch (const std::bad_alloc &) {
786788 return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
787789 } catch (...) {
You can’t perform that action at this time.
0 commit comments