|
1 | 1 | // RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
|
2 | 2 | // 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 \ |
4 | 4 | // RUN: --entry-point-result=void | FileCheck %s
|
5 | 5 | // RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
|
6 | 6 | // RUN: --runner mlir-cpu-runner -e main \
|
7 | 7 | // 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 |
9 | 9 | #map0 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>
|
10 | 10 | #map1 = affine_map<(d0, d1, d2, d3) -> (d3)>
|
11 | 11 | #map2 = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1 + d4, d2 + d5, d6)>
|
|
21 | 21 | #map12 = affine_map<(d0, d1, d2) -> (d0, d1)>
|
22 | 22 | #map13 = affine_map<(d0, d1) -> ()>
|
23 | 23 | #map14 = affine_map<(d0, d1) -> (d0, 0)>
|
| 24 | +#map15 = affine_map<(d0, d1, d2, d3, d4, d5) -> (d4, d5)> |
24 | 25 | module @mnist_cnn {
|
25 | 26 | func.func @main() {
|
26 | 27 | %0 = arith.constant dense<1.0> : tensor<1x224x224x1xf32>
|
@@ -103,9 +104,10 @@ module @mnist_cnn {
|
103 | 104 | linalg.yield %44 : f32
|
104 | 105 | } -> tensor<1x224x224x64xf32>
|
105 | 106 | %18 = tensor.empty() : tensor<1x112x112x64xf32>
|
| 107 | + %fake = tensor.empty(): tensor<2x2xf32> |
106 | 108 | %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): |
109 | 111 | %44 = arith.cmpf ogt, %arg10, %arg9 : f32
|
110 | 112 | %45 = arith.select %44, %arg10, %arg9 : f32
|
111 | 113 | linalg.yield %45 : f32
|
@@ -181,3 +183,9 @@ module @mnist_cnn {
|
181 | 183 | return %43 : tensor<1x100xf32>
|
182 | 184 | }
|
183 | 185 | }
|
| 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