Mapping image objects

As discussed in the mapping of buffer objects in the previous chapter, images can also be mapped to a host pointer. Images computed at the device may sometimes needs to be available at the host address space, say for writing the image back to the file system. The clEnqueueMapImage function will map the image from the device memory to the host address space. This is also a task which is enqueued on the device command_queue.

void * clEnqueueMapImage (cl_command_queue command_queue,cl_mem image,cl_bool blocking_map,cl_map_flags map_flags,const size_t *origin,const size_t *region,size_t *image_row_pitch,size_t *image_slice_pitch,cl_uint num_events_in_wait_list,const cl_event *event_wait_list,cl_event *event,cl_int *errcode_ret) ...

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.