|
1 | 1 | // RUN: iree-opt --pass-pipeline='builtin.module(iree-llvmcpu-select-lowering-strategy)' --split-input-file %s | FileCheck %s
|
| 2 | +// RUN: iree-opt --iree-llvmcpu-riscv-aggressive-distribution=true --pass-pipeline='builtin.module(iree-llvmcpu-select-lowering-strategy)' --split-input-file %s | FileCheck %s -check-prefixes=CHECK-AGGRESSIVE |
2 | 3 |
|
3 | 4 | #pipeline_layout = #hal.pipeline.layout<bindings = [
|
4 | 5 | #hal.pipeline.binding<storage_buffer>,
|
@@ -155,3 +156,36 @@ func.func @thin_depthwise_conv_static() attributes {hal.executable.target = #exe
|
155 | 156 | // CHECK-SAME: translation_info = #[[TRANSLATION]]
|
156 | 157 | // CHECK: linalg.depthwise_conv_2d_nhwc_hwc
|
157 | 158 | // CHECK-SAME: lowering_config = #[[CONFIG]]
|
| 159 | + |
| 160 | +// ----- |
| 161 | + |
| 162 | +#pipeline_layout = #hal.pipeline.layout<bindings = [ |
| 163 | + #hal.pipeline.binding<storage_buffer>, |
| 164 | + #hal.pipeline.binding<storage_buffer>, |
| 165 | + #hal.pipeline.binding<storage_buffer> |
| 166 | +]> |
| 167 | + |
| 168 | +#executable_target_embedded_elf_riscv_64_ = #hal.executable.target<"llvm-cpu", "embedded-elf-riscv_64", {cpu_features = "+m,+a,+f,+d,+zvl1024b,+v", data_layout = "e-m:e-p:64:64-i64:64-i256:256-n32:64-S256", native_vector_size = 256 : index, target_triple = "riscv64-unknown-unknown-eabi-elf"}> |
| 169 | +builtin.module { |
| 170 | + func.func @matmul_riscv_vl1024() attributes {hal.executable.target = #executable_target_embedded_elf_riscv_64_} { |
| 171 | + %cst = arith.constant 0.0 : f32 |
| 172 | + %0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) : !flow.dispatch.tensor<readonly:tensor<384x512xf32>> |
| 173 | + %1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) : !flow.dispatch.tensor<readonly:tensor<512x256xf32>> |
| 174 | + %2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(2) : !flow.dispatch.tensor<writeonly:tensor<384x256xf32>> |
| 175 | + %lhs = flow.dispatch.tensor.load %0, offsets = [0, 0], sizes = [384, 512], strides = [1, 1] : !flow.dispatch.tensor<readonly:tensor<384x512xf32>> -> tensor<384x512xf32> |
| 176 | + %rhs = flow.dispatch.tensor.load %1, offsets = [0, 0], sizes = [512, 256], strides = [1, 1] : !flow.dispatch.tensor<readonly:tensor<512x256xf32>> -> tensor<512x256xf32> |
| 177 | + %init = tensor.empty() : tensor<384x256xf32> |
| 178 | + %fill = linalg.fill ins(%cst : f32) outs(%init : tensor<384x256xf32>) -> tensor<384x256xf32> |
| 179 | + %res = linalg.matmul ins(%lhs, %rhs : tensor<384x512xf32>, tensor<512x256xf32>) outs(%fill : tensor<384x256xf32>) -> tensor<384x256xf32> |
| 180 | + flow.dispatch.tensor.store %res, %2, offsets = [0, 0], sizes = [384, 256], strides = [1, 1] : tensor<384x256xf32> -> !flow.dispatch.tensor<writeonly:tensor<384x256xf32>> |
| 181 | + return |
| 182 | + } |
| 183 | +} |
| 184 | + |
| 185 | +// CHECK-AGGRESSIVE-DAG: #[[CONFIG:.+]] = #iree_codegen.lowering_config<tile_sizes = {{\[}}[32, 256], [7, 128], [0, 0], [0, 0]]> |
| 186 | +// CHECK-AGGRESSIVE-DAG: #[[CONFIG2:.+]] = #iree_codegen.lowering_config<tile_sizes = {{\[}}[32, 256, 0], [32, 256, 0], [0, 0, 0], [7, 128, 0], [0, 0, 1], [0, 0, 0]]> |
| 187 | +// CHECK-AGGRESSIVE-DAG: #[[TRANSLATION:.+]] = #iree_codegen.translation_info<CPUDoubleTilingExpert, {{\{}}enable_loop_peeling}> |
| 188 | +// CHECK-AGGRESSIVE: func.func @matmul_riscv_vl1024() |
| 189 | +// CHECK-AGGRESSIVE-SAME: translation_info = #[[TRANSLATION]] |
| 190 | +// CHECK-AGGRESSIVE: linalg.matmul |
| 191 | +// CHECK-AGGRESSIVE-SAME: lowering_config = #[[CONFIG2]] |
0 commit comments