C Specification
To get information specific to the requirements of an image before creating it call the function
// Provided by cl_ext_image_requirements_info
cl_int clGetImageRequirementsInfoEXT(
cl_context context,
const cl_mem_properties* properties,
cl_mem_flags flags,
const cl_image_format* image_format,
const cl_image_desc* image_desc,
cl_image_requirements_info_ext param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
clGetImageRequirementsInfoEXT is provided by the cl_ext_image_requirements_info extension.
|
Parameters
-
context is the OpenCL context in which the query will be performed.
-
properties is an optional list of properties for the image object and their corresponding values. The list is terminated with the special property 0. If no properties are required, properties may be
NULL. -
flags is a bit-field that is used to specify allocation and usage information about the image format being queried and is described in the Memory Flags table. flags may be
CL_MEM_to specialize the query for images that may be read from and written to by different kernel instances when correctly ordered by event dependencies, orREAD_ WRITE CL_MEM_to specialize the query for images that may be read from by a kernel, orREAD_ ONLY CL_MEM_to specialiaze the query for images that may be written to by a kernel, orWRITE_ ONLY CL_MEM_to specialize the query for images that may be both read from and written to by the same kernel instance. When flags isKERNEL_ READ_ AND_ WRITE 0the value returned for the query must be correct for all possible values of flags. -
image_format is a pointer to a structure describing the format of the image for which requirements are being queried. Refer to the Image Format Descriptor section for a detailed description.
-
image_desc is a pointer to a structure that describes type and dimensions of the image for which requirements are being queried. Refer to the Image Descriptor section for a detailed description of the image descriptor.
-
param_name specifies the information to query. The list of supported param_name types and the information returned in param_value by clGetImageRequirementsInfoEXT is described in the Image Requirements 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 is used to specify the size in bytes of memory pointed to by param_value. This size must be ≥ size of return type as described in the Image Requirements Queries table.
-
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 Format Info | Return type | Info. returned in param_value |
|---|---|---|
provided by the |
|
Returns the minimum alignment in bytes required for the data store backing
an image created using the parameters passed to clGetImageRequirementsInfoEXT.
image_format or image_desc are allowed to be |
provided by the |
|
Returns the row pitch alignment required in bytes for images created from
a buffer with the parameters passed to clGetImageRequirementsInfoEXT.
The value returned is a power of two. image_format or image_desc
are allowed to be |
provided by the |
|
Returns the minimal size in bytes that a buffer would need to be to back an
image created using the parameters passed to clGetImageRequirementsInfoEXT.
|
provided by the |
|
Returns the max width supported for creating images with the parameters passed
to clGetImageRequirementsInfoEXT.
image_format or image_desc are allowed to be |
provided by the |
|
Returns the max height supported for creating images with the parameters passed
to clGetImageRequirementsInfoEXT.
image_format or image_desc are allowed to be |
provided by the |
|
Returns the max depth supported for creating images with the parameters passed
to clGetImageRequirementsInfoEXT.
image_format or image_desc are allowed to be |
provided by the |
|
Returns the max array size supported for creating images with the parameters passed
to clGetImageRequirementsInfoEXT.
image_format or image_desc are allowed to be |
provided by the |
|
Returns the slice pitch alignment required in bytes for images created from
a buffer with the parameters passed to clGetImageRequirementsInfoEXT.
The value returned is a power of two. image_format and image_desc are
allowed to be |
clGetImageRequirementsInfoEXT returns CL_SUCCESS if the function is executed
successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_if context if not a valid context.CONTEXT -
CL_INVALID_if a property name in properties is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.PROPERTY -
CL_INVALID_if values specified in flags are not valid.VALUE -
CL_INVALID_if values specified in image_format are not valid.IMAGE_ FORMAT_ DESCRIPTOR -
CL_INVALID_if values specified in image_desc are not valid.IMAGE_ DESCRIPTOR -
CL_INVALID_if param_name is not valid, or if size in bytes specified by param_value_size is < size of return type as described in the Image Requirements 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
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.