@@ -47,32 +47,26 @@ ur_result_t ur_exp_command_buffer_handle_t_::finalizeCommandBuffer() {
4747 isFinalized = true ;
4848 return UR_RESULT_SUCCESS;
4949}
50- ur_result_t ur_exp_command_buffer_handle_t_::awaitExecution (
51- locked<ur_command_list_manager> &commandList) {
52- std::ignore = commandList;
50+ ur_event_handle_t ur_exp_command_buffer_handle_t_::getCurrentExecutionEvent (
51+ [[maybe_unused]] locked<ur_command_list_manager> &commandList) {
5352 assert (
5453 commandList->getZeCommandList () ==
5554 commandListManager.get_no_lock ()->getZeCommandList () &&
5655 " Provided command list is not the same as the one in the command buffer" );
57- if (currentExecution) {
58- ZE2UR_CALL (zeEventHostSynchronize,
59- (currentExecution->getZeEvent (), UINT64_MAX));
60- UR_CALL (currentExecution->release ());
61- currentExecution = nullptr ;
62- }
63- return UR_RESULT_SUCCESS;
56+ return currentExecution;
6457}
6558
6659ur_result_t ur_exp_command_buffer_handle_t_::registerExecutionEvent (
67- locked<ur_command_list_manager> &commandList,
60+ [[maybe_unused]] locked<ur_command_list_manager> &commandList,
6861 ur_event_handle_t nextExecutionEvent) {
69- std::ignore = commandList;
7062 assert (
7163 commandList->getZeCommandList () ==
7264 commandListManager.get_no_lock ()->getZeCommandList () &&
7365 " Provided command list is not the same as the one in the command buffer" );
74- assert (currentExecution == nullptr &&
75- " Current execution event is not null, it should be awaited first" );
66+ if (currentExecution) {
67+ UR_CALL (currentExecution->release ());
68+ currentExecution = nullptr ;
69+ }
7670 if (nextExecutionEvent) {
7771 currentExecution = nextExecutionEvent;
7872 UR_CALL (nextExecutionEvent->retain ());
0 commit comments