diff --git a/source/adapters/cuda/command_buffer.cpp b/source/adapters/cuda/command_buffer.cpp index 93321a9b27..1ea823c255 100644 --- a/source/adapters/cuda/command_buffer.cpp +++ b/source/adapters/cuda/command_buffer.cpp @@ -401,8 +401,7 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) { UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) { - UR_ASSERT(!hCommandBuffer->IsFinalized, - UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP); + UR_ASSERT(!hCommandBuffer->IsFinalized, UR_RESULT_ERROR_INVALID_OPERATION); try { const unsigned long long flags = 0; #if CUDA_VERSION >= 12000 diff --git a/source/adapters/hip/command_buffer.cpp b/source/adapters/hip/command_buffer.cpp index 22b73c4dd4..c522f5324d 100644 --- a/source/adapters/hip/command_buffer.cpp +++ b/source/adapters/hip/command_buffer.cpp @@ -306,8 +306,7 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) { UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) { - UR_ASSERT(!hCommandBuffer->IsFinalized, - UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP); + UR_ASSERT(!hCommandBuffer->IsFinalized, UR_RESULT_ERROR_INVALID_OPERATION); try { const unsigned long long flags = 0; UR_CHECK_ERROR(hipGraphInstantiateWithFlags( diff --git a/source/adapters/level_zero/command_buffer.cpp b/source/adapters/level_zero/command_buffer.cpp index f4770a1f02..01cb2ebba0 100644 --- a/source/adapters/level_zero/command_buffer.cpp +++ b/source/adapters/level_zero/command_buffer.cpp @@ -595,8 +595,7 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t CommandBuffer) { ur_result_t urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t CommandBuffer) { UR_ASSERT(CommandBuffer, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(!CommandBuffer->IsFinalized, - UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP); + UR_ASSERT(!CommandBuffer->IsFinalized, UR_RESULT_ERROR_INVALID_OPERATION); // It is not allowed to append to command list from multiple threads. std::scoped_lock Guard(CommandBuffer->Mutex); diff --git a/source/adapters/opencl/command_buffer.cpp b/source/adapters/opencl/command_buffer.cpp index c723d7ef7d..ac23765f0f 100644 --- a/source/adapters/opencl/command_buffer.cpp +++ b/source/adapters/opencl/command_buffer.cpp @@ -124,8 +124,7 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) { UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) { - UR_ASSERT(!hCommandBuffer->IsFinalized, - UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP); + UR_ASSERT(!hCommandBuffer->IsFinalized, UR_RESULT_ERROR_INVALID_OPERATION); cl_context CLContext = cl_adapter::cast(hCommandBuffer->hContext); cl_ext::clFinalizeCommandBufferKHR_fn clFinalizeCommandBufferKHR = nullptr; UR_RETURN_ON_FAILURE( diff --git a/test/conformance/exp_command_buffer/commands.cpp b/test/conformance/exp_command_buffer/commands.cpp index 5d0fefad32..e14b321e2b 100644 --- a/test/conformance/exp_command_buffer/commands.cpp +++ b/test/conformance/exp_command_buffer/commands.cpp @@ -213,6 +213,6 @@ TEST_P(urCommandBufferAppendKernelLaunchExpTest, FinalizeTwice) { ASSERT_SUCCESS(urCommandBufferFinalizeExp(cmd_buf_handle)); EXPECT_EQ_RESULT(urCommandBufferFinalizeExp(cmd_buf_handle), - UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP); + UR_RESULT_ERROR_INVALID_OPERATION); }