File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1014,15 +1014,7 @@ ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
10141014 }
10151015
10161016 // Save pointer to the queue before deleting/resetting event.
1017- // When we add an event to the cache we need to check whether profiling is
1018- // enabled or not, so we access properties of the queue and that's why queue
1019- // must released later.
10201017 auto Queue = Event->UrQueue ;
1021- if (DisableEventsCaching || !Event->OwnNativeHandle ) {
1022- delete Event;
1023- } else {
1024- Event->Context ->addEventToContextCache (Event);
1025- }
10261018
10271019 // If the event was a timestamp recording, we try to evict its entry in the
10281020 // queue.
@@ -1041,6 +1033,15 @@ ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
10411033 }
10421034 }
10431035
1036+ // When we add an event to the cache we need to check whether profiling is
1037+ // enabled or not, so we access properties of the queue and that's why queue
1038+ // must released later.
1039+ if (DisableEventsCaching || !Event->OwnNativeHandle ) {
1040+ delete Event;
1041+ } else {
1042+ Event->Context ->addEventToContextCache (Event);
1043+ }
1044+
10441045 // We intentionally incremented the reference counter when an event is
10451046 // created so that we can avoid ur_queue_handle_t is released before the
10461047 // associated ur_event_handle_t is released. Here we have to decrement it so
You can’t perform that action at this time.
0 commit comments