diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir index 0018c07b342c5..ca02b4073aba9 100644 --- a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir +++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir @@ -23,7 +23,7 @@ affine_map<(i,j) -> (i,j)> // X (out) ], iterator_types = ["parallel", "parallel"], - doc = "X(i,j) = A(i,j)" + doc = "X(i,j) = A(i,j) * 2" } // @@ -39,11 +39,12 @@ // library. module { // - // A kernel that assigns elements from A to X. + // A kernel that assigns multiplied elements from A to X. // func.func @dense_output(%arga: tensor) -> tensor { %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index + %c2 = arith.constant 2.0 : f64 %d0 = tensor.dim %arga, %c0 : tensor %d1 = tensor.dim %arga, %c1 : tensor %init = bufferization.alloc_tensor(%d0, %d1) : tensor @@ -51,7 +52,8 @@ module { ins(%arga: tensor) outs(%init: tensor) { ^bb(%a: f64, %x: f64): - linalg.yield %a : f64 + %0 = arith.mulf %a, %c2 : f64 + linalg.yield %0 : f64 } -> tensor return %0 : tensor } @@ -78,7 +80,7 @@ module { // // Print the linearized 5x5 result for verification. // - // CHECK: ( 1, 0, 0, 1.4, 0, 0, 2, 0, 0, 2.5, 0, 0, 3, 0, 0, 4.1, 0, 0, 4, 0, 0, 5.2, 0, 0, 5 ) + // CHECK: ( 2, 0, 0, 2.8, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 8.2, 0, 0, 8, 0, 0, 10.4, 0, 0, 10 ) // %m = sparse_tensor.values %0 : tensor to memref