[Mlir-commits] [mlir] [mlir][SVE] Add more e2e test for vector.contract (PR #70367)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Oct 27 02:55:33 PDT 2023


================
@@ -30,6 +56,60 @@
   iterator_types = ["parallel", "parallel", "reduction"]
 }
 
+// Contraction: dot-product a x b.
+func.func @dot_product_i32() {
+  %acc = arith.constant 0: i32
+
+  %vector_a = arith.constant dense<123> : vector<[4]xi32>
+  %vector_b = arith.constant dense<314> : vector<[4]xi32>
+  %vector_c = arith.constant dense<0> : vector<[4]xi32>
+
+  // The result of this dot-product will depend
+  // on the vector length, so we are unable to verify it.
+  %dp1 = vector.contract #dotp_trait %vector_a, %vector_b, %acc
+    : vector<[4]xi32>, vector<[4]xi32> into i32
+  // DP: {{[0-9]*}}
+  vector.print %dp1 : i32
----------------
banach-space wrote:

Neat, I love this!

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


More information about the Mlir-commits mailing list