Skip to content

Add header file to define cooperative matrices in spir-v - #6720

Merged
Steven Perron (s-perron) merged 4 commits into
microsoft:mainfrom
s-perron:coop_matrix
Sep 25, 2024
Merged

Steven Perron (s-perron) merged 4 commits into
microsoft:mainfrom
s-perron:coop_matrix

Conversation

@s-perron

Copy link
Copy Markdown
Collaborator

This pr will introduce the HLSL standard header files. This will become the a
way to add new extensions to HLSL without having to make modifications to the
compiler.

This first example is a fairly complex example that demonstrates how to do a few
different things:

  1. Trying to create a simple class interface that allows the compiler to
    naturally enforce the validation rules. In this case, we might be more strict
    than the spir-v validation, but I believe this is still usable.
  2. How to create a builtin that can be expanded by the spir-v backend. The
    OpCooperativeMatrixLengthKHR instruction does not have an interface that is
    natural in a language like HLSL. However, we can define a function that is, and
    have the backend, make small adjustments. These cases should be avoided as much
    as possible.

@s-perron

Copy link
Copy Markdown
Collaborator Author

JN Mo (@EpicJeanNoeMorissette) FYI: You said you were interested in seeing this when it was ready to be made public. This will probably still go through some changes before it is merged, but this is the vision I have.

@github-actions

github-actions Bot commented Jun 28, 2024 •

Copy link
Copy Markdown
Contributor

✅ With the latest revision this PR passed the C/C++ code formatter.

@s-perron
Steven Perron (s-perron) force-pushed the coop_matrix branch 4 times, most recently from cf7be64 to 9546037 Compare July 5, 2024 15:04
@s-perron
Steven Perron (s-perron) force-pushed the coop_matrix branch 2 times, most recently from c71eb29 to 1e0ddd0 Compare July 18, 2024 12:54
@s-perron
Steven Perron (s-perron) force-pushed the coop_matrix branch 2 times, most recently from ec32d8a to 1922a69 Compare July 31, 2024 18:51
@s-perron
Steven Perron (s-perron) force-pushed the coop_matrix branch 3 times, most recently from 64f4aa6 to df118bc Compare August 21, 2024 17:30
@s-perron
Steven Perron (s-perron) force-pushed the coop_matrix branch 4 times, most recently from 3028830 to b5403c4 Compare September 17, 2024 13:37
Implements [HLSL spec proposal 0021](https://github.com/microsoft/hlsl-specs/blob/9c42e278961dbf5b77d7d18b1e7ba7f6c0856154/proposals/0021-vk-coop-matrix.md)

This commit adds a header file to the HLSL Standard Header library to
implement cooperative matrices for SPIR-V. See the proposal for the
specifics of the interface, and design decisions.
@s-perron
Steven Perron (s-perron) merged commit c299228 into microsoft:main Sep 25, 2024
@s-perron
Steven Perron (s-perron) deleted the coop_matrix branch September 26, 2024 15:53
Mxr (SjMxr233) pushed a commit to ShaderHelper/DirectXShaderCompiler that referenced this pull request Jul 24, 2025
)

This pr will introduce the HLSL standard header files. This will become
the a
way to add new extensions to HLSL without having to make modifications
to the
compiler.

This first example is a fairly complex example that demonstrates how to
do a few
different things:

1. Trying to create a simple class interface that allows the compiler to
naturally enforce the validation rules. In this case, we might be more
strict
than the spir-v validation, but I believe this is still usable.
2. How to create a builtin that can be expanded by the spir-v backend.
The
OpCooperativeMatrixLengthKHR instruction does not have an interface that
is
natural in a language like HLSL. However, we can define a function that
is, and
have the backend, make small adjustments. These cases should be avoided
as much
as possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants