Ratification Status

Not ratified

Extension and Version Dependencies

Other Extension Metadata

Last Modified Date

2025-01-06

IP Status

No known IP claims.

Interactions and External Dependencies
  • This extension interacts with cl_khr_image2d_from_buffer

Contributors
  • Kevin Petit, Arm Ltd.

  • Jeremy Kemp, Imagination Technologies

  • Alastair Murray, Codeplay Software Ltd.

  • Balaji Calidas, Qualcomm

Description

This extension enables applications to query requirements for an image without having to create the image.

New Commands

  • clGetImageRequirementsInfoEXT

New Types

  • cl_image_requirements_info_ext

New Enums

  • cl_image_requirements_info_ext

    • CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT

    • CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT

    • CL_IMAGE_REQUIREMENTS_SIZE_EXT

    • CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT

    • CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT

    • CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT

    • CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT

Conformance tests

  1. Basic checks for CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT and CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT

    • For all image formats and types

      • Check that the CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT and CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT queries can be performed successfully and that the values returned are a power of two.

  2. Check consistency with cl_khr_image2d_from_buffer

    • When cl_khr_image2d_from_buffer is supported, check that the value returned by CL_DEVICE_IMAGE_PITCH_ALIGNMENT after converting in bytes for the supported format with the biggest element size (channel data type size * number of channels) is greater than or equal to the value returned by CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT for all supported formats.

    • When cl_khr_image2d_from_buffer is supported, check that the value returned by CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT after converting in bytes for the supported format with the biggest element size (channel data type size * number of channels) is greater than or equal to the value returned by CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT for all supported formats.

  3. Negative tests for CL_IMAGE_REQUIREMENTS_SIZE_EXT

    • Check that attempting to perform the CL_IMAGE_REQUIREMENTS_SIZE_EXT query without specifying the image_format results in CL_INVALID_VALUE being returned.

    • Check that attempting to perform the CL_IMAGE_REQUIREMENTS_SIZE_EXT query without specifying the image_desc results in CL_INVALID_VALUE being returned.

  4. Consistency checks for CL_IMAGE_REQUIREMENTS_SIZE_EXT

    • When creating 2D images from a buffer is supported, for all formats and a selection of image dimensions

      • Check that the CL_IMAGE_REQUIREMENTS_SIZE_EXT query can be performed successfully.

      • Create a buffer with the size returned and check that an image can successfully be created from the buffer.

      • Check that the value returned for CL_MEM_SIZE for the image is the same as the value returned for CL_IMAGE_REQUIREMENTS_SIZE_EXT.

  5. Consistency checks for CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT

    • For all image formats, image types and a selection of values for other members in image_desc (that MUST include 0)

      • Check that the CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT query can be performed successfully

      • Check that the value is smaller than or equal to the value returned for CL_DEVICE_IMAGE_MAX_BUFFER_SIZE for images of CL_MEM_OBJECT_IMAGE1D_BUFFER type or smaller than or equal to the value returned for CL_DEVICE_IMAGE3D_MAX_WIDTH for images of CL_MEM_OBJECT_IMAGE3D type or smaller than or equal to the value returned for CL_DEVICE_IMAGE2D_MAX_WIDTH for all other image types.

  6. Negative tests for CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT

    • Attempt to perform the CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT query on all image types for which it is not valid

    • Check that CL_INVALID_IMAGE_DESCRIPTOR is returned in all cases.

  7. Consistency checks for CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT

    • For all image formats, valid image types and a selection of values for other members in image_desc (that MUST include 0)

      • Check that the CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT query can be performed successfully

      • Check that the value is smaller than or equal to the value returned for CL_DEVICE_IMAGE2D_MAX_HEIGHT for 2D or 2D array images or CL_DEVICE_IMAGE3D_MAX_HEIGHT for 3D images.

  8. Negative testing for CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT

    • Attempt to perform the CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT query on all image types for which it is not valid

    • Check that CL_INVALID_IMAGE_DESCRIPTOR is returned in all cases.

  9. Consistency checks for CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT

    • For all image formats, valid image types and a selection of values for other members in image_desc (that MUST include 0)

      • Check that the CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT query can be performed successfully

      • Check that the value is smaller than or equal to the value returned for CL_DEVICE_IMAGE3D_MAX_DEPTH.

  10. Negative testing for CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT

    • Attempt to perform the CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT query on all image types for which it is not valid

    • Check that CL_INVALID_IMAGE_DESCRIPTOR is returned in all cases.

  11. Consistency checks for CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT

    • For all image formats, valid image types and a selection of values for other members in image_desc (that MUST include 0)

      • Check that the CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT query can be performed successfully

      • Check that the value is smaller than or equal to the value returned for CL_DEVICE_IMAGE_MAX_ARRAY_SIZE.

  12. General negative testing for clGetImageRequirementsInfoEXT

    • Write tests for all possible testable generic error codes.

Issues

None.

Version History

  • Revision 0.5.0, 2022-01-18

    • First version.

See Also

No cross-references are available

Document Notes

For more information, see the OpenCL Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Copyright 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0