Skip to content

Commit e6161ee

Browse files
author
Mikołaj Komar
committed
Release internal event after creation
1 parent 40aa326 commit e6161ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,14 +929,17 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueCommandBufferExp(
929929
ze_command_list_handle_t commandBufferCommandList =
930930
commandListLocked->getZeCommandList();
931931
ur_event_handle_t internalEvent = nullptr;
932-
if (!phEvent) {
932+
if (phEvent == nullptr) {
933933
phEvent = &internalEvent;
934934
}
935935
UR_CALL(hCommandBuffer->awaitExecution(commandListLocked));
936936
UR_CALL(enqueueGenericCommandListsExp(1, &commandBufferCommandList, phEvent,
937937
numEventsInWaitList, phEventWaitList,
938938
UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP));
939939
UR_CALL(hCommandBuffer->registerExecutionEvent(commandListLocked, *phEvent));
940+
if (internalEvent != nullptr) {
941+
internalEvent->release();
942+
}
940943
return UR_RESULT_SUCCESS;
941944
}
942945

0 commit comments

Comments
 (0)