You will quickly realize how useful the event mechanism in OpenCL is in controlling the various parts of your algorithm, and it can be found in the common kernel and memory commands. This recipe will continue from creating memory objects and focus on how those memory objects can be transferred from the host memory to the device memory and vice versa and we'll be fixated on the data transfer APIs
clEnqueueWriteBuffer, which is for one-dimensional data blocks, and
clEnqueueWriteBufferRect for two-dimensional data blocks; we'll also look at
clEnqueueCopyBuffer for data transfers between memory objects in the device. First, we look at copying data between memory ...