[llvm] [mlir] Add ContractionOpInterface utility functions for vector matrix multiplication (PR #68945)

Diego Caballero via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 11:18:40 PDT 2023


================
@@ -49,6 +49,24 @@ bool isColumnMajorMatmul(ArrayAttr indexingMaps);
 /// the reduction.
 bool isRowMajorBatchMatmul(ArrayAttr indexingMaps);
 
+/// Tests whether the given maps describe a vector matrix multiplication. The
+/// test is permutation-invariant. Note that this only checks the affine maps
+/// from an operation, so does not perform any checks on the math being
+/// performed within the reduction.
+bool isVecmat(ArrayAttr indexingMaps);
+
+/// Tests whether the given maps describe a matrix vector multiplication. The
+/// test is permutation-invariant. Note that this only checks the affine maps
+/// from an operation, so does not perform any checks on the math being
+/// performed within the reduction.
+bool isMatvec(ArrayAttr indexingMaps);
+
+/// Tests whether the given maps describe a batch matrix vector multiplication.
+/// The test is permutation-invariant. Note that this only checks the affine
+/// maps from an operation, so does not perform any checks on the math being
+/// performed within the reduction.
+bool isBatchMatvec(ArrayAttr indexingMaps);
----------------
dcaballe wrote:

nit: rename to `VecMatMul`/`MatVecMul`,  `VectorMatrixMult`/`MatrixVectorMult` or similar?

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


More information about the llvm-commits mailing list