[clang] [lldb] [llvm] [OpenCL][Clang] Add support for cooperative matrix extension (PR #221328)
Dmitry Sidorov via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 05:17:10 PDT 2026
================
@@ -1483,6 +1483,53 @@ See the OpenCL documentation for some more complete examples.
}];
}
+def CoopMatrixTypeDocs : Documentation {
+ let Category = DocCatType;
+ let Heading = "coop_mat";
+ let Content = [{
+The `coop_mat` attribute declares an OpenCL cooperative matrix type. Cooperative
+matrix operations are distributed across a set of invocations, such as a
+subgroup, allowing the implementation to optimize matrix multiply operations.
+
+The attribute is applied to a scalar numerical component type and takes four
+arguments:
+
+```c
+__attribute__((coop_mat(scope, rows, columns, use)))
+```
+- scope specifies the memory scope of the cooperative matrix.
+ It must be one of the supported OpenCL memory scopes, such as CLK_COOPERATIVE_MATRIX_SCOPE_SUBGROUP.
+- rows specifies the number of rows in the matrix. It must be a constant expression.
+- columns specifies the number of columns in the matrix. It must be a constant expression.
----------------
MrSidims wrote:
But where? https://github.com/KhronosGroup/OpenCL-Docs/pull/1533 doesn't mention it.
See my head comment - the specification that is listed in RFC as well as the RFC doesn't have any of the restrictions imposed or assumed in the implementation. It doesn't mean, that the assumptions are wrong - I see why we can only have constant expression shape, but it would be nice to compare implementation with the actual specification in many other things.
https://github.com/llvm/llvm-project/pull/221328
More information about the llvm-commits
mailing list