To wait for completion of commands on a device, call the function
cl_int clFinish( cl_command_queue command_queue);
command_queue is the command queue to wait for.
All previously queued OpenCL commands in command_queue are issued to the associated device, and the function blocks until all previously queued commands have completed. clFinish does not return until all previously queued commands in command_queue have been processed and completed. clFinish is also a synchronization point.
CL_SUCCESS if the function call was executed
Otherwise, it returns one of the following errors:
CL_INVALID_COMMAND_QUEUEif command_queue is not a valid host command-queue.
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
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 (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.