[Mlir-commits] [mlir] 0f29012 - [mlir] Fix test by adapting to C util functions moving to libmlir_c_runner_utils

Nicolas Vasilache llvmlistbot at llvm.org
Thu Jan 28 09:41:03 PST 2021


Author: Nicolas Vasilache
Date: 2021-01-28T17:35:51Z
New Revision: 0f2901201e26c236e38b11fe602d6357782f865d

URL: https://github.com/llvm/llvm-project/commit/0f2901201e26c236e38b11fe602d6357782f865d
DIFF: https://github.com/llvm/llvm-project/commit/0f2901201e26c236e38b11fe602d6357782f865d.diff

LOG: [mlir] Fix test by adapting to C util functions moving to libmlir_c_runner_utils

Added: 
    

Modified: 
    mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir b/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir
index 742a2385f002..5653d77ffede 100644
--- a/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir
+++ b/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt -convert-linalg-to-loops -lower-affine -convert-scf-to-std -convert-std-to-llvm %s | mlir-cpu-runner -O3 -e main -entry-point-result=void -shared-libs=%mlir_runner_utils_dir/libmlir_runner_utils%shlibext | FileCheck %s
+// RUN: mlir-opt -convert-linalg-to-loops -lower-affine -convert-scf-to-std -convert-vector-to-llvm -convert-std-to-llvm %s | mlir-cpu-runner -O3 -e main -entry-point-result=void -shared-libs=%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext | FileCheck %s
 
 func @main() {
   %A = alloc() : memref<16x16xf32>
@@ -20,8 +20,8 @@ func @main() {
   %t_end = call @rtclock() : () -> f64
   %t = subf %t_end, %t_start : f64
 
-  %pC = memref_cast %C : memref<16x16xf32> to memref<*xf32>
-  call @print_memref_f32(%pC) : (memref<*xf32>) -> ()
+  %res = affine.load %C[0, 0]: memref<16x16xf32>
+  vector.print %res: f32
 
   %c0 = constant 0 : index
   %c1 = constant 1 : index
@@ -44,7 +44,7 @@ func @main() {
 
   return
 }
-// CHECK: 17,   17,   17,
+// CHECK: 17
 
 func @sgemm_naive(%arg0: memref<16x16xf32>, %arg1: memref<16x16xf32>, %arg2: memref<16x16xf32>) {
   %c0 = constant 0 : index
@@ -71,4 +71,3 @@ func @sgemm_naive(%arg0: memref<16x16xf32>, %arg1: memref<16x16xf32>, %arg2: mem
 
 func private @print_flops(f64)
 func private @rtclock() -> f64
-func private @print_memref_f32(memref<*xf32>)


        


More information about the Mlir-commits mailing list