-// 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 \
-// 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 | \
-// 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 | \
-// 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
-// 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 | \
//
func.func @dump(%arg0: memref<?xf64>) {
%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<?xf64>, vector<8xf64>
vector.print %0 : vector<8xf64>
return
//
// 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<?x?xf64, #DCSR> to memref<?xf64>
%m2 = sparse_tensor.values %2 : tensor<?x?xf64, #DCSC> to memref<?xf64>
-// 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 | \
//
func.func @dumpf64(%arg0: memref<?xf64>) {
%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<?xf64>, vector<8xf64>
vector.print %0 : vector<8xf64>
return
}
func.func @dumpi08(%arg0: memref<?xi8>) {
%c = arith.constant 0 : index
- %d = arith.constant -1 : i8
+ %d = arith.constant 0 : i8
%0 = vector.transfer_read %arg0[%c], %d: memref<?xi8>, vector<8xi8>
vector.print %0 : vector<8xi8>
return
}
func.func @dumpi32(%arg0: memref<?xi32>) {
%c = arith.constant 0 : index
- %d = arith.constant -1 : i32
+ %d = arith.constant 0 : i32
%0 = vector.transfer_read %arg0[%c], %d: memref<?xi32>, vector<8xi32>
vector.print %0 : vector<8xi32>
return
}
func.func @dumpi64(%arg0: memref<?xi64>) {
%c = arith.constant 0 : index
- %d = arith.constant -1 : i64
+ %d = arith.constant 0 : i64
%0 = vector.transfer_read %arg0[%c], %d: memref<?xi64>, vector<8xi64>
vector.print %0 : vector<8xi64>
return
//
// 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<?xf64>
%m2 = sparse_tensor.values %2 : tensor<32x64xf64, #DCSC> to memref<?xf64>
//
// 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<?xi8>
%i2 = sparse_tensor.indices %2 { dimension = 1 : index } : tensor<32x64xf64, #DCSC> to memref<?xi64>
-// 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 | \
-// 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 | \
// 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<
//
// 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<?xf32>
- %vv = vector.transfer_read %val[%c0], %f1: memref<?xf32>, vector<4xf32>
+ %vv = vector.transfer_read %val[%c0], %f0: memref<?xf32>, vector<4xf32>
vector.print %vv : vector<4xf32>
// Release the resources.
-// 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 | \
// 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<
//
// 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
-// 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 | \