C Specification

To finalize command recording ready for enqueuinga command-buffer on a command-queue, call the function

// Provided by cl_khr_command_buffer
cl_int clFinalizeCommandBufferKHR(
    cl_command_buffer_khr command_buffer);
clFinalizeCommandBufferKHR is provided by the cl_khr_command_buffer extension.

Parameters

  • command_buffer refers to a valid command-buffer object.

Description

clFinalizeCommandBufferKHR places the command-buffer in the Executable state where commands can no longer be recorded, at this point the command-buffer is ready to be enqueued.

clFinalizeCommandBufferKHR returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

  • CL_INVALID_COMMAND_BUFFER_KHR if command_buffer is not a valid command-buffer.

  • CL_INVALID_OPERATION if command_buffer is not in the Recording state.

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

See Also

Document Notes

For more information, see the OpenCL Specification

This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0