diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir @@ -1,4 +1,11 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: TENSOR0="%mlir_src_dir/test/Integration/data/test.mtx" \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=false | \ // RUN: TENSOR0="%mlir_src_dir/test/Integration/data/test.mtx" \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_bf16.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_bf16.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_bf16.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_bf16.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=false | \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_f16.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_f16.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_f16.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output_f16.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=false | \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_codegen_foreach.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_codegen_foreach.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_codegen_foreach.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_codegen_foreach.mlir @@ -1,5 +1,12 @@ -// RUN: mlir-opt %s --sparse-compiler | \ -// RUN: mlir-cpu-runner -e entry -entry-point-result=void \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=false | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ // RUN: FileCheck %s diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_dyn.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_dyn.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_dyn.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_dyn.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler="enable-runtime-library=false enable-buffer-initialization=true" | \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ @@ -26,7 +32,7 @@ // func.func @dump(%arg0: memref) { %c = arith.constant 0 : index - %d = arith.constant -1.0 : f64 + %d = arith.constant 0.0 : f64 %0 = vector.transfer_read %arg0[%c], %d: memref, vector<8xf64> vector.print %0 : vector<8xf64> return @@ -51,12 +57,12 @@ // // All proper row-/column-wise? // - // CHECK: ( 1, 2, 3, 4, 5, 6, 7, -1 ) - // CHECK: ( 1, 4, 6, 2, 5, 3, 7, -1 ) - // CHECK: ( 1, 2, 3, 4, 5, 6, 7, -1 ) - // CHECK: ( 1, 4, 6, 2, 5, 3, 7, -1 ) - // CHECK: ( 1, 4, 6, 2, 5, 3, 7, -1 ) - // CHECK: ( 1, 2, 3, 4, 5, 6, 7, -1 ) + // CHECK: ( 1, 2, 3, 4, 5, 6, 7, 0 ) + // CHECK: ( 1, 4, 6, 2, 5, 3, 7, 0 ) + // CHECK: ( 1, 2, 3, 4, 5, 6, 7, 0 ) + // CHECK: ( 1, 4, 6, 2, 5, 3, 7, 0 ) + // CHECK: ( 1, 4, 6, 2, 5, 3, 7, 0 ) + // CHECK: ( 1, 2, 3, 4, 5, 6, 7, 0 ) // %m1 = sparse_tensor.values %1 : tensor to memref %m2 = sparse_tensor.values %2 : tensor to memref diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_ptr.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_ptr.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_ptr.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conversion_ptr.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler="enable-runtime-library=false enable-buffer-initialization=true" | \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ @@ -37,28 +43,28 @@ // func.func @dumpf64(%arg0: memref) { %c = arith.constant 0 : index - %d = arith.constant -1.0 : f64 + %d = arith.constant 0.0 : f64 %0 = vector.transfer_read %arg0[%c], %d: memref, vector<8xf64> vector.print %0 : vector<8xf64> return } func.func @dumpi08(%arg0: memref) { %c = arith.constant 0 : index - %d = arith.constant -1 : i8 + %d = arith.constant 0 : i8 %0 = vector.transfer_read %arg0[%c], %d: memref, vector<8xi8> vector.print %0 : vector<8xi8> return } func.func @dumpi32(%arg0: memref) { %c = arith.constant 0 : index - %d = arith.constant -1 : i32 + %d = arith.constant 0 : i32 %0 = vector.transfer_read %arg0[%c], %d: memref, vector<8xi32> vector.print %0 : vector<8xi32> return } func.func @dumpi64(%arg0: memref) { %c = arith.constant 0 : index - %d = arith.constant -1 : i64 + %d = arith.constant 0 : i64 %0 = vector.transfer_read %arg0[%c], %d: memref, vector<8xi64> vector.print %0 : vector<8xi64> return @@ -84,12 +90,12 @@ // // All proper row-/column-wise? // - // CHECK: ( 1, 2, 3, 4, 5, 6, 7, -1 ) - // CHECK-NEXT: ( 1, 4, 6, 2, 5, 3, 7, -1 ) - // CHECK-NEXT: ( 1, 4, 6, 2, 5, 3, 7, -1 ) - // CHECK-NEXT: ( 1, 4, 6, 2, 5, 3, 7, -1 ) - // CHECK-NEXT: ( 1, 2, 3, 4, 5, 6, 7, -1 ) - // CHECK-NEXT: ( 1, 2, 3, 4, 5, 6, 7, -1 ) + // CHECK: ( 1, 2, 3, 4, 5, 6, 7, 0 ) + // CHECK-NEXT: ( 1, 4, 6, 2, 5, 3, 7, 0 ) + // CHECK-NEXT: ( 1, 4, 6, 2, 5, 3, 7, 0 ) + // CHECK-NEXT: ( 1, 4, 6, 2, 5, 3, 7, 0 ) + // CHECK-NEXT: ( 1, 2, 3, 4, 5, 6, 7, 0 ) + // CHECK-NEXT: ( 1, 2, 3, 4, 5, 6, 7, 0 ) // %m1 = sparse_tensor.values %1 : tensor<32x64xf64, #DCSR> to memref %m2 = sparse_tensor.values %2 : tensor<32x64xf64, #DCSC> to memref @@ -107,12 +113,12 @@ // // Sanity check on indices. // - // CHECK-NEXT: ( 0, 1, 63, 0, 1, 0, 63, -1 ) - // CHECK-NEXT: ( 0, 1, 31, 0, 1, 0, 31, -1 ) - // CHECK-NEXT: ( 0, 1, 31, 0, 1, 0, 31, -1 ) - // CHECK-NEXT: ( 0, 1, 31, 0, 1, 0, 31, -1 ) - // CHECK-NEXT: ( 0, 1, 63, 0, 1, 0, 63, -1 ) - // CHECK-NEXT: ( 0, 1, 63, 0, 1, 0, 63, -1 ) + // CHECK-NEXT: ( 0, 1, 63, 0, 1, 0, 63, 0 ) + // CHECK-NEXT: ( 0, 1, 31, 0, 1, 0, 31, 0 ) + // CHECK-NEXT: ( 0, 1, 31, 0, 1, 0, 31, 0 ) + // CHECK-NEXT: ( 0, 1, 31, 0, 1, 0, 31, 0 ) + // CHECK-NEXT: ( 0, 1, 63, 0, 1, 0, 63, 0 ) + // CHECK-NEXT: ( 0, 1, 63, 0, 1, 0, 63, 0 ) // %i1 = sparse_tensor.indices %1 { dimension = 1 : index } : tensor<32x64xf64, #DCSR> to memref %i2 = sparse_tensor.indices %2 { dimension = 1 : index } : tensor<32x64xf64, #DCSC> to memref diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matrix_ops.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matrix_ops.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matrix_ops.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matrix_ops.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=false | \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_mult_elt.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_mult_elt.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_mult_elt.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_mult_elt.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler="enable-runtime-library=false enable-buffer-initialization=true"| \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ @@ -36,7 +42,7 @@ // Driver method to call and verify kernel. func.func @entry() { %c0 = arith.constant 0 : index - %f1 = arith.constant -1.0 : f32 + %f0 = arith.constant 0.0 : f32 // Setup very sparse matrices. %ta = arith.constant sparse< @@ -58,10 +64,10 @@ // // Verify results. Only two entries stored in result! // - // CHECK: ( 14, 20, -1, -1 ) + // CHECK: ( 14, 20, 0, 0 ) // %val = sparse_tensor.values %0 : tensor<32x16xf32, #DCSR> to memref - %vv = vector.transfer_read %val[%c0], %f1: memref, vector<4xf32> + %vv = vector.transfer_read %val[%c0], %f0: memref, vector<4xf32> vector.print %vv : vector<4xf32> // Release the resources. diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_reduction.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_reduction.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_reduction.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_reduction.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler="enable-runtime-library=false enable-buffer-initialization=true"| \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ @@ -46,7 +52,7 @@ // Driver method to call and verify tensor kernel. func.func @entry() { %c0 = arith.constant 0 : index - %i0 = arith.constant -1 : i32 + %i0 = arith.constant 0 : i32 // Setup very sparse 3-d tensors. %t1 = arith.constant sparse< @@ -68,7 +74,7 @@ // // Verify results. Only two entries stored in result. Correct structure. // - // CHECK: ( 7, 69, -1, -1 ) + // CHECK: ( 7, 69, 0, 0 ) // CHECK-NEXT: ( ( 0, 0, 0 ), ( 0, 7, 0 ), ( 0, 0, 69 ) ) // %val = sparse_tensor.values %0 diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_storage.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_storage.mlir --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_storage.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_storage.mlir @@ -1,4 +1,10 @@ -// RUN: mlir-opt %s --sparse-compiler | \ +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=true | \ +// RUN: mlir-cpu-runner \ +// RUN: -e entry -entry-point-result=void \ +// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \ +// RUN: FileCheck %s + +// RUN: mlir-opt %s --sparse-compiler=enable-runtime-library=false | \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \