Skip to content

Commit 7be3e15

Browse files
committed
init test
1 parent aa1243a commit 7be3e15

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// RUN: gc-opt %s --split-input-file --propagate-layout-on-named-ops | FileCheck %s
2+
3+
// CHECK-LABEL: @single_matmul_f32
4+
func.func @single_matmul_f32(%arg0: tensor<128x64xf32>, %arg1: tensor<64x32xf32>) -> tensor<128x32xf32> {
5+
%cst = arith.constant 0.000000e+00 : f32
6+
%0 = tensor.empty() : tensor<128x32xf32>
7+
%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<128x32xf32>) -> tensor<128x32xf32>
8+
%2 = linalg.matmul ins(%arg0, %arg1 : tensor<128x64xf32>, tensor<64x32xf32>) outs(%0 : tensor<128x32xf32>) -> tensor<128x32xf32>
9+
return %2 : tensor<128x32xf32>
10+
}
11+
// CHECK-COUNT-3: tensor.pack
12+
// CHECK-COUNT-1: linalg.mmt4d
13+
// CHECK-COUNT-1: tensor.unpack
14+
15+
// CHECK-LABEL: @single_matmul_bf16
16+
func.func @single_matmul_bf16(%arg0: tensor<128x64xbf16>, %arg1: tensor<64x32xbf16>) -> tensor<128x32xbf16> {
17+
%cst = arith.constant 0.000000e+00 : bf16
18+
%0 = tensor.empty() : tensor<128x32xbf16>
19+
%1 = linalg.fill ins(%cst : bf16) outs(%0 : tensor<128x32xbf16>) -> tensor<128x32xbf16>
20+
%2 = linalg.matmul ins(%arg0, %arg1 : tensor<128x64xbf16>, tensor<64x32xbf16>) outs(%0 : tensor<128x32xbf16>) -> tensor<128x32xbf16>
21+
return %2 : tensor<128x32xbf16>
22+
}
23+
// CHECK-COUNT-4: tensor.pack
24+
// CHECK-COUNT-1: linalgx.mm4d_vnni
25+
// CHECK-COUNT-1: tensor.unpack

0 commit comments

Comments
 (0)