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(
625
625
// /< events to wait for completion
626
626
) {
627
627
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) {
629
630
// Make sure to add all host-visible "proxy" event signals if needed.
630
631
// This ensures that all signalling commands are submitted below and
631
632
// thus proxy events can be waited without a deadlock.
632
633
//
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);
635
635
if (!Event->hasExternalRefs ())
636
636
die (" urEventsWait must not be called for an internal event" );
637
637
@@ -782,6 +782,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(
782
782
Context, UR_EXT_COMMAND_TYPE_USER,
783
783
Properties->isNativeHandleOwned );
784
784
785
+ UREvent->RefCountExternal ++;
786
+
785
787
} catch (const std::bad_alloc &) {
786
788
return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
787
789
} catch (...) {
You can’t perform that action at this time.
0 commit comments