[OpenCL] Fix image2d_t qualifier for intel_sub_group_block_write_ui (#199232)
The intel_sub_group_block_write_ui[2,4,8] overloads for image2d_t were
declared with a read_only qualifier, both in opencl-c.h and in
OpenCLBuiltins.td. A write operation cannot target a read_only image,
and
the base intel_sub_group_block_write together with the analogous _us,
_uc
and _ul aliases all correctly use write_only image2d_t.
Per the cl_intel_subgroups_short [1], cl_intel_subgroups_char [2] and
cl_intel_subgroups_long [3] specifications, the _ui aliases are added
"for
naming consistency [...] There is no change to the description or
behavior
of these functions" relative to the cl_intel_subgroups base, which uses
write_only image2d_t for writes.
The typo was introduced in b833bf6ae14f and preserved across all
later edits to this area.
Switch the qualifier from read_only to write_only in both opencl-c.h and
OpenCLBuiltins.td, and update intel-subgroups-builtins.cl to match the
corrected signature (the existing test was exercising the buggy
overload).
[1]
https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroups_short.html
[2]
https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroups_char.html
[3]
https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroups_long.html
Co-Authored-By: Claude Opus
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>