The two functions clEnqueueCopyBuffer
and clEnqueueCopyBufferRect
enable the application to copy data between two OpenCL buffer objects. It is equivalent to reading the buffer back from device to host and then writing it back to a destination cl_mem
object. This mechanism is provided by these copy buffer routines:
cl_int clEnqueueCopyBuffer(cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_buffer,size_t src_offset, size_t dst_offset,size_t size,cl_uint num_events_in_wait_list,const cl_event *event_wait_list,cl_event *event)
This OpenCL API enqueue's a command to copy a cl_mem
buffer object identified by src_buffer
to another cl_mem
object destination buffer, dst_buffer
. Remaining parameters like offset
and events
are similar to the one in clEnqueue[Read|Write]Buffer
routines.
Similarly if one wants to copy only a small rectangular region in the cl_mem
buffer then he can use the API:
cl_int clEnqueueCopyBufferRect(cl_command_queue command_queue,cl_mem src_buffer,cl_mem...