Skip to content

Commit 9d319a7

Browse files
committed
[L0] Cleanup Queue even after failure
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
1 parent 9babc4d commit 9d319a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/adapters/level_zero/queue.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueRelease(
407407
//
408408
// It is possible to get to here and still have an open command list
409409
// if no wait or finish ever occurred for this queue.
410-
if (auto Res = Queue->executeAllOpenCommandLists())
411-
return Res;
410+
auto Res = Queue->executeAllOpenCommandLists();
412411

413412
// Make sure all commands get executed.
414-
UR_CALL(Queue->synchronize());
413+
if (Res == UR_RESULT_SUCCESS)
414+
UR_CALL(Queue->synchronize());
415415

416416
// Destroy all the fences created associated with this queue.
417417
for (auto it = Queue->CommandListMap.begin();

0 commit comments

Comments
 (0)