Copying buffers
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 ...
Get OpenCL Programming by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.