Image objects can be created using the following function call:
cl_mem clCreateImage (cl_context context,cl_mem_flags flags,const cl_image_format *image_format,const cl_image_desc *image_desc,void *host_ptr,cl_int *errcode_ret)
A single function call supports the creation of a 1D, 2D, and 3D image object, which can either be transferred to the device or can be formed in the device. Besides this, the same function call can be used to create an array of 1D and 2D image objects using the cl_image_desc
data structure. We will discuss more on this later. In OpenCL 1.1 instead of one function clCreateImage
, there were two different functions clCreateImage2D
and clCreateImage3D
.
The function call clCreateImage
takes the usual four arguments as used in the clCreateBuffer
. They are the context
, flags
, host_ptr
, and error_code
. The definition of these parameters is similar to that discussed in context with clCreateBuffer
. If the flags
parameter is specified as 0
then the default value...