[llvm-branch-commits] [mlir] [mlir][linalg] Decompose winograd operators (PR #96183)

Oleksandr Alex Zinenko via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 24 06:08:20 PDT 2024


================
@@ -36,6 +189,92 @@ constexpr TransformMapKeyTy F_2_3{2, 3};
 constexpr TransformMapKeyTy F_4_3{4, 3};
 constexpr TransformMapKeyTy F_2_5{2, 5};
 
+struct TransformMatrix {
+  TransformMatrix(const float *table, int64_t rows, int64_t cols,
+                  int64_t scalarFactor = 1)
+      : table(table), rows(rows), cols(cols), scalarFactor(scalarFactor) {}
+
+  const float *table;
+  int64_t rows;
+  int64_t cols;
+  int64_t scalarFactor;
+};
+
+Value create2DTransformMatrix(RewriterBase &rewriter, Location loc,
+                              TransformMatrix transform, Type type) {
+  ArrayRef<float> const_vec(transform.table, transform.rows * transform.cols);
----------------
ftynse wrote:

Nit: camelBack
```suggestion
  ArrayRef<float> constVec(transform.table, transform.rows * transform.cols);
```

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


More information about the llvm-branch-commits mailing list