Skip to content

Commit 048a585

Browse files
authored
Merge pull request #560 from chencha3/refactor
Enable MnistCnn
2 parents 879c46c + e8d76b4 commit 048a585

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/PlaidML/OpTest.MnistCnn.mlir

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
22
// RUN: --runner mlir-cpu-runner -e main \
3-
// RUN: --shared-libs=%mlir_runner_utils \
3+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \
44
// RUN: --entry-point-result=void | FileCheck %s
55
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
66
// RUN: --runner mlir-cpu-runner -e main \
77
// RUN: --entry-point-result=void \
8-
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
8+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%levelzero_runtime | FileCheck %s
99
#map0 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>
1010
#map1 = affine_map<(d0, d1, d2, d3) -> (d3)>
1111
#map2 = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1 + d4, d2 + d5, d6)>
@@ -21,6 +21,7 @@
2121
#map12 = affine_map<(d0, d1, d2) -> (d0, d1)>
2222
#map13 = affine_map<(d0, d1) -> ()>
2323
#map14 = affine_map<(d0, d1) -> (d0, 0)>
24+
#map15 = affine_map<(d0, d1, d2, d3, d4, d5) -> (d4, d5)>
2425
module @mnist_cnn {
2526
func.func @main() {
2627
%0 = arith.constant dense<1.0> : tensor<1x224x224x1xf32>
@@ -103,9 +104,10 @@ module @mnist_cnn {
103104
linalg.yield %44 : f32
104105
} -> tensor<1x224x224x64xf32>
105106
%18 = tensor.empty() : tensor<1x112x112x64xf32>
107+
%fake = tensor.empty(): tensor<2x2xf32>
106108
%19 = linalg.fill ins(%cst : f32) outs(%18 : tensor<1x112x112x64xf32>) -> tensor<1x112x112x64xf32>
107-
%20 = linalg.generic {indexing_maps = [#map6, #map7], iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction", "reduction"]} ins(%17 : tensor<1x224x224x64xf32>) outs(%19 : tensor<1x112x112x64xf32>) attrs = {iterator_ranges = [1, 112, 112, 64, 2, 2]} {
108-
^bb0(%arg9: f32, %arg10: f32):
109+
%20 = linalg.generic {indexing_maps = [#map6, #map15, #map7], iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction", "reduction"]} ins(%17, %fake : tensor<1x224x224x64xf32>, tensor<2x2xf32>) outs(%19 : tensor<1x112x112x64xf32>) attrs = {iterator_ranges = [1, 112, 112, 64, 2, 2]} {
110+
^bb0(%arg9: f32, %arg_f: f32, %arg10: f32):
109111
%44 = arith.cmpf ogt, %arg10, %arg9 : f32
110112
%45 = arith.select %44, %arg10, %arg9 : f32
111113
linalg.yield %45 : f32
@@ -181,3 +183,9 @@ module @mnist_cnn {
181183
return %43 : tensor<1x100xf32>
182184
}
183185
}
186+
187+
// CHECK: Unranked Memref base@ = {{0x[-9a-f]*}}
188+
// CHECK-SAME: rank = {{.}} offset = {{.}} sizes = [1, 100] strides = {{.*}} data =
189+
// CHECK: 0.01
190+
// CHECK: 0.01
191+
// CHECK: 0.01

0 commit comments

Comments
 (0)