[Lldb-commits] [clang] [lldb] [llvm] [OpenCL][Clang] Add support for cooperative matrix extension (PR #221328)

Sven van Haastregt via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 9 08:49:42 PDT 2026


================
@@ -0,0 +1,87 @@
+// Tests for coop_mat_init and coop_mat_length — Sema (positive).
+//
+// RUN: %clang_cc1 -triple spirv64-unknown-unknown \
+// RUN:   -cl-std=CL2.0 -cl-ext=+cl_khr_cooperative_matrix \
+// RUN:   -finclude-default-header -fsyntax-only -verify %s
+
+// expected-no-diagnostics
+
+// ---------------------------------------------------------------------------
+// Type definitions shared across all tests.
+// ---------------------------------------------------------------------------
+#pragma OPENCL EXTENSION cl_khr_cooperative_matrix : enable
+
+typedef float __attribute__((coop_mat(memory_scope_sub_group,
+                                      16, 16,
+                                      CLK_COOPERATIVE_MATRIX_A)))           MatA_t;
+typedef float __attribute__((coop_mat(memory_scope_sub_group,
+                                      16, 16,
+                                      CLK_COOPERATIVE_MATRIX_B)))           MatB_t;
+typedef float __attribute__((coop_mat(memory_scope_sub_group,
+                                      16, 16,
+                                      CLK_COOPERATIVE_MATRIX_ACCUMULATOR))) MatC_t;
+typedef int   __attribute__((coop_mat(memory_scope_sub_group,
+                                      16, 16,
+                                      CLK_COOPERATIVE_MATRIX_A)))           MatA_int_t;
+
+// ---------------------------------------------------------------------------
----------------
svenvh wrote:

Nit, applies to all tests: I don't think these `-----` separators are needed per function. Just the comment should suffice.

https://github.com/llvm/llvm-project/pull/221328


More information about the lldb-commits mailing list