Skip to content

WIP cl_khr_cooperative_matrix#1533

Open
kpet wants to merge 1 commit into
mainfrom
cl-khr-cooperative-matrix
Open

WIP cl_khr_cooperative_matrix#1533
kpet wants to merge 1 commit into
mainfrom
cl-khr-cooperative-matrix

Conversation

@kpet
Copy link
Copy Markdown
Contributor

@kpet kpet commented Mar 4, 2026

No description provided.

Change-Id: I902b6ac47788dfb5083463e3ab02a23985e1ba52
@kpet
Copy link
Copy Markdown
Contributor Author

kpet commented Mar 4, 2026

This PR currently captures the working draft for the coming cl_khr_cooperative_matrix extension. The OpenCL working group is still making minor changes to the specification. We decided to continue doing this in public so we could engage with a wider set of stakeholders. Feedback welcome!

Comment thread env/extensions.asciidoc
{clGetDeviceCooperativeMatrixInfoKHR} device query, otherwise
the behavior of the program is undefined.

For *OpTypeCooperativeMatrixMulAddKHR*, the operands must match a supported
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
For *OpTypeCooperativeMatrixMulAddKHR*, the operands must match a supported
For *OpCooperativeMatrixMulAddKHR*, the operands must match a supported

Comment on lines +2477 to +2480
* {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT8_KHR_anchor} corresponds to SPIR-V `OpTypeInt 8 0`.
* {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT16_KHR_anchor} corresponds to SPIR-V `OpTypeInt 16 0`.
* {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT32_KHR_anchor} corresponds to SPIR-V `OpTypeInt 32 0`.
* {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT64_KHR_anchor} corresponds to SPIR-V `OpTypeInt 64 0`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should these be OpTypeInt xx 1 to indicate signedness?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably not, as the OpenCL SPIR-V Environment Specification Section 4 "Validation Rules" says:

For all OpTypeInt integer type-declaration instructions:

  • Signedness must be 0, indicating no signedness semantics.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Got it, thanks!

Comment thread xml/cl.xml
Comment on lines +8105 to +8107
<type name="cl_device_cooperative_matrix_variant_khr"/>
<type name="cl_device_cooperative_matrix_component_type_khr"/>
<type name="cl_device_cooperative_matrix_info_khr"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

...variant_khr should go after ...component_type_khr as the former (a struct type) contains elements of the latter, and the wrong order breaks the generated header. I'd suggest putting the struct type after the cl_uint types, like so:

Suggested change
<type name="cl_device_cooperative_matrix_variant_khr"/>
<type name="cl_device_cooperative_matrix_component_type_khr"/>
<type name="cl_device_cooperative_matrix_info_khr"/>
<type name="cl_device_cooperative_matrix_component_type_khr"/>
<type name="cl_device_cooperative_matrix_info_khr"/>
<type name="cl_device_cooperative_matrix_variant_khr"/>

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.

4 participants