Skip to content

Commit

Permalink
Add specification for cl_ext_image_unorm_int_2_101010
Browse files Browse the repository at this point in the history
Change-Id: I51b0ec6f719c30a01637c56047a86d31fd78b7ca
  • Loading branch information
kpet committed Aug 14, 2024
1 parent b32ac1b commit deee182
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 1 deletion.
14 changes: 14 additions & 0 deletions OpenCL_C.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ clock shared by all work-items executing in the same work-group.
clock shared by all work-items executing in the same sub-group.
endif::cl_khr_kernel_clock[]

ifdef::cl_ext_image_unorm_int_2_101010[]
| {opencl_c_ext_image_unorm_int_2_101010}
| The OpenCL C compiler supports returning `CLK_UNORM_INT_2_101010_EXT` from
`get_image_channel_data_type`.
endif::cl_ext_image_unorm_int_2_101010[]

|====

In OpenCL C 3.0 or newer, feature macros must expand to the value `1` if the
Expand Down Expand Up @@ -12483,6 +12489,14 @@ endif::cl_khr_gl_msaa_sharing[]

`CLK_UNORM_INT_101010_2` footnote:[{fn-CLK_UNORM_INT_101010_2}]

ifdef::cl_ext_image_unorm_int_2_101010[]
Additionally, if the {opencl_c_ext_image_unorm_int_2_101010} feature macro is
supported:

`CLK_UNORM_INT_2_101010_EXT`

endif::cl_ext_image_unorm_int_2_101010[]

| int *get_image_channel_order*(_aQual_ image2d_t _image_) +
int *get_image_channel_order*(_aQual_ image3d_t _image_)

Expand Down
39 changes: 39 additions & 0 deletions api/cl_ext_image_unorm_int_2_101010.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2020-2024 The Khronos Group Inc.
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}cl_ext_image_unorm_int_2_101010.txt[]

=== Other Extension Metadata

*Last Modified Date*::
2024-05-10
*IP Status*::
No known IP claims.
*Contributors*::
- Kévin Petit, Arm Ltd.

=== Description

{cl_ext_image_unorm_int_2_101010_EXT} adds support for the {CL_UNORM_INT_2_101010_EXT}
image format.

OpenCL C compilers supporting this extension will define the
{opencl_c_ext_image_unorm_int_2_101010} feature macro.

=== New feature macro

* {opencl_c_ext_image_unorm_int_2_101010}

=== New Enums

* {cl_channel_type_TYPE}
** {CL_UNORM_INT_2_101010_EXT}

=== New OpenCL C channel data type

* `CLK_UNORM_INT_2_101010_EXT`

=== Version History

* Revision 1.0.0, 2024-05-10
** Initial version
13 changes: 13 additions & 0 deletions api/opencl_runtime_layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2474,6 +2474,15 @@ include::{generated}/api/version-notes/CL_UNORM_INT_101010_2.asciidoc[]

include::{generated}/api/version-notes/CL_SIGNED_INT8.asciidoc[]
| Each channel component is an unnormalized signed 8-bit integer value

ifdef::cl_ext_image_unorm_int_2_101010[]
| {CL_UNORM_INT_2_101010_EXT_anchor}

include::{generated}/api/version-notes/CL_UNORM_INT_2_101010_EXT.asciidoc[]
| Represents a normalized 2-10-10-10 four-channel ABGR image.
The channel order must be {CL_ABGR}.
endif::cl_ext_image_unorm_int_2_101010[]

| {CL_SIGNED_INT16_anchor}

include::{generated}/api/version-notes/CL_SIGNED_INT16.asciidoc[]
Expand Down Expand Up @@ -2565,6 +2574,10 @@ For {CL_UNORM_INT_101010}, bits 31:30 are undefined, R is in bits 29:20, G in
bits 19:10 and B in bits 9:0.
For {CL_UNORM_INT_101010_2}, R is in bits 31:22, G in bits 21:12, B in bits
11:2 and A in bits 1:0.
ifdef::cl_ext_image_unorm_int_2_101010[]
For {CL_UNORM_INT_2_101010_EXT}, A is in bits 31:30, B in bits 29:20, G in bits
19:10 and R in bits 9:0.
endif::cl_ext_image_unorm_int_2_101010[]

OpenCL implementations must maintain the minimum precision specified by the
number of bits in `image_channel_data_type`.
Expand Down
1 change: 1 addition & 0 deletions c/features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ __opencl_c_integer_dot_product_input_4x8bit_packed
__opencl_c_kernel_clock_scope_device
__opencl_c_kernel_clock_scope_work_group
__opencl_c_kernel_clock_scope_sub_group
__opencl_c_ext_image_unorm_int_2_101010
5 changes: 5 additions & 0 deletions env/common_properties.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ channel data types.
| *UnormInt101010_2*
| {CL_UNORM_INT_101010_2}

ifdef::cl_ext_image_unorm_int_2_101010[]
| 21
| *UnormInt2_101010EXT*
| {CL_UNORM_INT_2_101010_EXT}
endif::cl_ext_image_unorm_int_2_101010[]
|====

[NOTE]
Expand Down
8 changes: 7 additions & 1 deletion xml/cl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,8 @@ server's OpenCL/api-docs repository.
<unused start="0x10E1" end="0x10E2" comment="Reserved for cl_ext_yuv_images #722"/>
<enum value="0x10E3" name="CL_UNSIGNED_INT_RAW10_EXT"/>
<enum value="0x10E4" name="CL_UNSIGNED_INT_RAW12_EXT"/>
<unused start="0x10E5" end="0x10EF" comment="Reserved for cl_channel_type"/>
<enum value="0x10E5" name="CL_UNORM_INT_2_101010_EXT"/>
<unused start="0x10E6" end="0x10EF" comment="Reserved for cl_channel_type"/>
<enum value="0x10F0" name="CL_MEM_OBJECT_BUFFER"/>
<enum value="0x10F1" name="CL_MEM_OBJECT_IMAGE2D"/>
<enum value="0x10F2" name="CL_MEM_OBJECT_IMAGE3D"/>
Expand Down Expand Up @@ -7475,5 +7476,10 @@ server's OpenCL/api-docs repository.
<enum name="CL_DEVICE_KERNEL_CLOCK_SCOPE_SUB_GROUP_KHR"/>
</require>
</extension>
<extension name="cl_ext_image_unorm_int_2_101010" revision="1.0.0" depends="CL_VERSION_1_2" supported="opencl">
<require comment="cl_channel_type">
<enum name="CL_UNORM_INT_2_101010_EXT"/>
</require>
</extension>
</extensions>
</registry>

0 comments on commit deee182

Please sign in to comment.