Skip to content

Commit 2324230

Browse files
igchorkbenzie
authored andcommitted
Fix adding event to queue cache
in single-device scenario. When event is an internal event (when using queue with discard events property) the UrQueue is set to nullptr. This means that inside addEventToContextCache the event will be added to a multi-device cache which is wrong. This causes unbounded growth of the multi-device event cache if there are no multi-device events requested from the cache.
1 parent 1539cbc commit 2324230

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

source/adapters/level_zero/queue.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,8 +1514,7 @@ ur_queue_handle_t_::resetDiscardedEvent(ur_command_list_ptr_t CommandList) {
15141514
}
15151515

15161516
ur_result_t ur_queue_handle_t_::addEventToQueueCache(ur_event_handle_t Event) {
1517-
if (!Event->IsMultiDevice && Event->UrQueue) {
1518-
auto Device = Event->UrQueue->Device;
1517+
if (!Event->IsMultiDevice) {
15191518
auto EventCachesMap = Event->isHostVisible() ? &EventCachesDeviceMap[0]
15201519
: &EventCachesDeviceMap[1];
15211520
if (EventCachesMap->find(Device) == EventCachesMap->end()) {

0 commit comments

Comments
 (0)