December 2013
Beginner to intermediate
304 pages
7h 20m
English
By now you know how to create buffer objects and how to read them in the kernel. Before the kernel is launched you may want to write the buffer to the device memory using the API clEnqueueWriteBuffer. And after the kernel has completed processing, you will want to get the buffer back to the host from the device memory. This can be achieved by using the clEnqueueReadBuffer function.
cl_int clEnqueueWriteBuffer (cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_write,size_t offset,size_t size,const void *ptr,cl_uint num_events_in_wait_list,const cl_event *event_wait_list,cl_event *event)
This function writes data from the host to the device memory. Following are the descriptions of the parameters passed.
|
Parameter ... |
|---|
Read now
Unlock full access