C Specification
To get information specific to an image object created with clCreateImage, clCreateImageWithProperties, clCreateImage2D, or clCreateImage3D call the function
// Provided by CL_VERSION_1_0
cl_int clGetImageInfo(
cl_mem image,
cl_image_info param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
Parameters
-
image specifies the image object being queried.
-
param_name specifies the information to query. The list of supported param_name types and the information returned in param_value by clGetImageInfo is described in the Image Object Queries table.
-
param_value is a pointer to memory where the appropriate result being queried is returned. If param_value is
NULL, it is ignored. -
param_value_size specifies the size in bytes of memory pointed to by param_value. This size must be greater than or equal to the size of the return type specified in the Image Object Queries table. If param_value is
NULL, it is ignored. -
param_value_size_ret returns the actual size in bytes of data being queried by param_name. If param_value_size_ret is
NULL, it is ignored.
Description
| Image Info | Return type | Description |
|---|---|---|
|
|
Return the image format descriptor specified when image is created with clCreateImage, clCreateImageWithProperties, clCreateImage2D or clCreateImage3D. |
|
|
Return size of each element of the image memory object given by image in bytes. |
|
|
Returns the row pitch in bytes of a row of elements of the
image object given by image. |
|
|
Returns the slice pitch in bytes of a 2D slice for the 3D
image object or size of each image in a 1D or 2D image array given
by image. |
|
|
Return width of the image in pixels. |
|
|
Return height of the image in pixels. For a 1D image, 1D image buffer and 1D image array object, height = 0. |
|
|
Return depth of the image in pixels. For a 1D image, 1D image buffer, 2D image or 1D and 2D image array object, depth = 0. |
missing before version 1.2. |
|
Return number of images in the image array. If image is not an image array, 0 is returned. |
missing before version 1.2 and deprecated by version 2.0. |
|
Return buffer object associated with image. |
missing before version 1.2. |
|
Return |
missing before version 1.2. |
|
Return |
provided by the |
|
If image was created using clCreateFromDX9MediaSurfaceKHR, returns the plane argument specified when image was created. |
provided by the |
|
If image was created using clCreateFromD3D10Texture2DKHR, or clCreateFromD3D10Texture3DKHR, returns the subresource argument specified when image was created. |
provided by the |
|
If image was created using clCreateFromD3D11Texture2DKHR, or clCreateFromD3D11Texture3DKHR, returns the subresource argument specified when image was created. |
clGetImageInfo returns CL_SUCCESS if the function is executed
successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_if image is a not a valid image object.MEM_ OBJECT -
CL_INVALID_if param_name is not one of the supported values, or if the size in bytes specified by param_value_size is less than size of the return type specified in the Image Object Queries table and param_value is notVALUE NULL. -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
The following errors may be returned if the cl_khr_
extension is supported:
-
CL_INVALID_if param_name isDX9_ MEDIA_ SURFACE_ KHR CL_IMAGE_and image was not created by calling clCreateFromDX9MediaSurfaceKHR.DX9_ MEDIA_ PLANE_ KHR
The following errors may be returned if the cl_khr_
extension is supported:
-
CL_INVALID_if param_name isD3D10_ RESOURCE_ KHR CL_IMAGE_and image was not created by the function clCreateFromD3D10Texture2DKHR, or clCreateFromD3D10Texture3DKHR.D3D10_ SUBRESOURCE_ KHR
The following errors may be returned if the cl_khr_
extension is supported:
-
CL_INVALID_if param_name isD3D11_ RESOURCE_ KHR CL_IMAGE_and image was not created by the function clCreateFromD3D11Texture2DKHR, or clCreateFromD3D11Texture3DKHR.D3D11_ SUBRESOURCE_ KHR
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.