Skip to content

[SYCL] Fix SPIR-V type requirements for image operations#21937

Open
Seanst98 wants to merge 2 commits intointel:syclfrom
Seanst98:sean/spirv-gen-fix
Open

[SYCL] Fix SPIR-V type requirements for image operations#21937
Seanst98 wants to merge 2 commits intointel:syclfrom
Seanst98:sean/spirv-gen-fix

Conversation

@Seanst98
Copy link
Copy Markdown
Contributor

@Seanst98 Seanst98 commented May 5, 2026

The SPIR-V OpenCL environment spec requires OpImageRead, OpImageWrite, OpImageFetch, and OpImageSampleExplicitLod to use vec4 operands with 32-bit component types (or 16-bit for half). Channel sizes and narrow integer types (8-bit and 16-bit) must be widened to their vec4 32-bit equivalents for the SPIR-V instruction.

All __invoke__Image* functions now use these helpers to ensure correct SPIR-V type generation.

Addresses: #21366

The SPIR-V OpenCL environment spec requires OpImageRead, OpImageWrite,
OpImageFetch, and OpImageSampleExplicitLod to use vec4 operands with
32-bit component types (or 16-bit for half). Channel sizes and narrow
integer types (8-bit and 16-bit) must be widened to their vec4 32-bit
equivalents for the SPIR-V instruction.

All __invoke__Image* functions now use these helpers to ensure correct
SPIR-V type generation.
@Seanst98 Seanst98 requested a review from a team as a code owner May 5, 2026 13:10
@Seanst98 Seanst98 requested a review from sergey-semenov May 5, 2026 13:10
Copy link
Copy Markdown
Contributor

@sergey-semenov sergey-semenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread sycl/include/sycl/detail/image_ocl_types.hpp Outdated
@Seanst98
Copy link
Copy Markdown
Contributor Author

Seanst98 commented May 7, 2026

Hi @sergey-semenov, thanks for the review! Could you please add any relevant reviewer who could kickoff CI and get this merged?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants