Add cl_khr_cooperative_matrix tests#2655
Conversation
96d41e3 to
d865c53
Compare
1714294 to
bcd2025
Compare
| case CoopMatOp::multicomponent_load: | ||
| case CoopMatOp::multicomponent_store: | ||
| spirv_text << R"( | ||
| %matSrc = OpCooperativeMatrixLoadKHR )" << getResTy() << R"( %in)" << variant.order << R"( %layout)" << variant.order << R"( %stride)" << variant.order << R"( |
There was a problem hiding this comment.
matAty should be the type always used for OpCooperativeMatrixLoadKHR in the copy tests.
When a unary variant is created, variant.inputA, variant.inputB and variant.inputC matrices use the same size (rows x cols).
For example, for a supported variant that uses MatrixA (64 x 16) and MatrixB (16 x 64), if the order of the copy operation is B, variant.inputA and variant.inputB will be 16x64. This results on the next SPIR-V being generated:
%sizeM = OpConstant %i32 16
%sizeK = OpConstant %i32 64
%sizeN = OpConstant %i32 64
And then matBty will be used resulting in storing a 64x64 matrix in a buffer of size 16x64
There was a problem hiding this comment.
Nice catch, thanks! Always using matAty would mean the OpCooperativeMatrixLoadKHR operations are only tested with Use = MatrixAKHR, whereas we should cover all Use values. I'll prepare a different fix.
There was a problem hiding this comment.
I've pushed a fix now; let me know if this works for you.
Add tests for the `cl_khr_cooperative_matrix` extension. The extension defines various operations on cooperative matrix types. The list of tested operations is in `cooperative_matrix.def`. Each entry in that `.def` file results in a subtest. Each subtest will iterate over all supported variants reported by the runtime and test each variant. An individual variant can be run using the `--variant` command line option. This CTS suite generates textual SPIR-V and uses spirv-tools to assemble the textual SPIR-V into a SPIR-V binary. Co-authored-by: Jacob Hodgson <jacob.hodgson@arm.com> Co-authored-by: Martin Fredin <martin.fredin@arm.com> Co-authored-by: Nico Reissmann <nico.reissmann@arm.com> Co-authored-by: Pedro Olsen Ferreira <pedro.olsenferreira@arm.com> Co-authored-by: Riccardo Zanetti <riccardo.zanetti@arm.com> Co-authored-by: Stuart Brady <stuart.brady@arm.com> Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
bcd2025 to
e980541
Compare
Add tests for the
cl_khr_cooperative_matrixextension.The extension defines various operations on cooperative matrix types. The list of tested operations is in
cooperative_matrix.def. Each entry in that.deffile results in a subtest.Each subtest will iterate over all supported variants reported by the runtime and test each variant. An individual variant can be run using the
--variantcommand line option.This CTS suite generates textual SPIR-V and uses spirv-tools to assemble the textual SPIR-V into a SPIR-V binary.