Skip to content

Commit 2558a03

Browse files
committed
fixup! [mlir][SVE] Add more e2e test for vector.contract
Update the dot product teset to check the actual result (thanks Ben)
1 parent 7a0d0c6 commit 2558a03

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/test-contraction.mlir

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ func.func @dot_product_i32() {
6868
// on the vector length, so we are unable to verify it.
6969
%dp1 = vector.contract #dotp_trait %vector_a, %vector_b, %acc
7070
: vector<[4]xi32>, vector<[4]xi32> into i32
71-
// DP: {{[0-9]*}}
72-
vector.print %dp1 : i32
71+
// Dot product should be (123 * 314) * 4 * vscale, so ...
72+
%vscale = vector.vscale
73+
%vscale_i32 = arith.index_cast %vscale : index to i32
74+
%dp1_divvl = arith.divui %dp1, %vscale_i32 : i32
75+
// ... %dp/%vscale = 123 * 314 * 4 = 154488
76+
// DP: 154488
77+
vector.print %dp1_divvl : i32
7378

7479
// The result of this dot-product should be 0.
7580
%dp2 = vector.contract #dotp_trait %vector_a, %vector_c, %acc

0 commit comments

Comments
 (0)