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) {
1014
1014
}
1015
1015
1016
1016
// 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.
1020
1017
auto Queue = Event->UrQueue ;
1021
- if (DisableEventsCaching || !Event->OwnNativeHandle ) {
1022
- delete Event;
1023
- } else {
1024
- Event->Context ->addEventToContextCache (Event);
1025
- }
1026
1018
1027
1019
// If the event was a timestamp recording, we try to evict its entry in the
1028
1020
// queue.
@@ -1041,6 +1033,15 @@ ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
1041
1033
}
1042
1034
}
1043
1035
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
+
1044
1045
// We intentionally incremented the reference counter when an event is
1045
1046
// created so that we can avoid ur_queue_handle_t is released before the
1046
1047
// 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