Skip to content

Commit 404f1c3

Browse files
kswiecickiKornevNikita
authored andcommitted
[UR][L0] Move async pool cleanup after queue sync (#18331)
In a scenario where the AsyncPool freelist contains an entry tied to a free event that hasn't completed yet, performing freelist cleanup before queue sync can result in freeing memory that's actively in use.
1 parent dbb7b24 commit 404f1c3

File tree

1 file changed

+3
-0
lines changed
  • unified-runtime/source/adapters/level_zero

1 file changed

+3
-0
lines changed

unified-runtime/source/adapters/level_zero/queue.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,9 @@ ur_result_t urQueueRelease(
625625
if (Res == UR_RESULT_SUCCESS)
626626
UR_CALL(Queue->synchronize());
627627

628+
// Cleanup the allocations from 'AsyncPool' made by this queue.
629+
Queue->Context->AsyncPool.cleanupPoolsForQueue(Queue);
630+
628631
// Destroy all the fences created associated with this queue.
629632
for (auto it = Queue->CommandListMap.begin();
630633
it != Queue->CommandListMap.end(); ++it) {

0 commit comments

Comments
 (0)