Skip to content

[mlir][sparse][tensor] replace bufferization with empty tensor #66450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module {
%c2 = arith.constant 2.0 : f64
%d0 = tensor.dim %arga, %c0 : tensor<?x?xf64, #SparseMatrix>
%d1 = tensor.dim %arga, %c1 : tensor<?x?xf64, #SparseMatrix>
%init = bufferization.alloc_tensor(%d0, %d1) : tensor<?x?xf64, #DenseMatrix>
%init = tensor.empty(%d0, %d1) : tensor<?x?xf64, #DenseMatrix>
%0 = linalg.generic #trait_assign
ins(%arga: tensor<?x?xf64, #SparseMatrix>)
outs(%init: tensor<?x?xf64, #DenseMatrix>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module {
%argb: tensor<?xbf16, #SparseVector>) -> tensor<?xbf16, #DenseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xbf16, #SparseVector>
%xv = bufferization.alloc_tensor (%d) : tensor<?xbf16, #DenseVector>
%xv = tensor.empty (%d) : tensor<?xbf16, #DenseVector>
%0 = linalg.generic #trait_vec_op
ins(%arga, %argb: tensor<?xbf16, #SparseVector>, tensor<?xbf16, #SparseVector>)
outs(%xv: tensor<?xbf16, #DenseVector>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module {
%argb: tensor<?xf16, #SparseVector>) -> tensor<?xf16, #DenseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xf16, #SparseVector>
%xv = bufferization.alloc_tensor (%d) : tensor<?xf16, #DenseVector>
%xv = tensor.empty (%d) : tensor<?xf16, #DenseVector>
%0 = linalg.generic #trait_vec_op
ins(%arga, %argb: tensor<?xf16, #SparseVector>, tensor<?xf16, #SparseVector>)
outs(%xv: tensor<?xf16, #DenseVector>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module {

func.func @conv2d_all_sparse_DCSR(%input: tensor<8x8xi32, #DCSR>,
%filter: tensor<3x3xi32, #DCSR>) -> tensor<6x6xi32, #DCSR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #DCSR>
%s = tensor.empty() : tensor<6x6xi32, #DCSR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #DCSR>, tensor<3x3xi32, #DCSR>)
outs (%s: tensor<6x6xi32, #DCSR>) -> tensor<6x6xi32, #DCSR>
Expand All @@ -60,7 +60,7 @@ module {

func.func @conv2d_all_sparse_CSR(%input: tensor<8x8xi32, #CSR>,
%filter: tensor<3x3xi32, #CSR>) -> tensor<6x6xi32, #CSR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #CSR>
%s = tensor.empty() : tensor<6x6xi32, #CSR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #CSR>, tensor<3x3xi32, #CSR>)
outs (%s: tensor<6x6xi32, #CSR>) -> tensor<6x6xi32, #CSR>
Expand All @@ -69,7 +69,7 @@ module {

func.func @conv2d_all_sparse_CD(%input: tensor<8x8xi32, #CDR>,
%filter: tensor<3x3xi32, #CDR>) -> tensor<6x6xi32, #CDR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #CDR>
%s = tensor.empty() : tensor<6x6xi32, #CDR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #CDR>, tensor<3x3xi32, #CDR>)
outs (%s: tensor<6x6xi32, #CDR>) -> tensor<6x6xi32, #CDR>
Expand All @@ -78,7 +78,7 @@ module {

func.func @conv2d_all_sparse_CSC(%input: tensor<8x8xi32, #CSC>,
%filter: tensor<3x3xi32, #CSC>) -> tensor<6x6xi32, #CSC> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #CSC>
%s = tensor.empty() : tensor<6x6xi32, #CSC>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #CSC>, tensor<3x3xi32, #CSC>)
outs (%s: tensor<6x6xi32, #CSC>) -> tensor<6x6xi32, #CSC>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module {
-> tensor<?xf64, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arg0, %c0 : tensor<?xf64, #SparseVector>
%xin = bufferization.alloc_tensor(%d) : tensor<?xf64, #SparseVector>
%xin = tensor.empty(%d) : tensor<?xf64, #SparseVector>
%0 = linalg.generic #trait_op
ins(%arg0: tensor<?xf64, #SparseVector>)
outs(%xin: tensor<?xf64, #SparseVector>) {
Expand All @@ -61,7 +61,7 @@ module {
-> tensor<?xi32, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arg0, %c0 : tensor<?xi32, #SparseVector>
%xin = bufferization.alloc_tensor(%d) : tensor<?xi32, #SparseVector>
%xin = tensor.empty(%d) : tensor<?xi32, #SparseVector>
%0 = linalg.generic #trait_op
ins(%arg0: tensor<?xi32, #SparseVector>)
outs(%xin: tensor<?xi32, #SparseVector>) {
Expand Down
22 changes: 11 additions & 11 deletions mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_binary.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module {
%argb: tensor<?xi32, #SparseVector>) -> tensor<?xi32, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xi32, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xi32, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xi32, #SparseVector>
%0 = linalg.generic #trait_vec_op
ins(%arga, %argb: tensor<?xi32, #SparseVector>, tensor<?xi32, #SparseVector>)
outs(%xv: tensor<?xi32, #SparseVector>) {
Expand All @@ -97,7 +97,7 @@ module {
%argb: tensor<?xf64>) -> tensor<?xf64, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xf64, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xf64, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xf64, #SparseVector>
%0 = linalg.generic #trait_vec_op
ins(%arga, %argb: tensor<?xf64, #SparseVector>, tensor<?xf64>)
outs(%xv: tensor<?xf64, #SparseVector>) {
Expand All @@ -121,7 +121,7 @@ module {
%argb: tensor<?xf64, #SparseVector>) -> tensor<?xf64, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xf64, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xf64, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xf64, #SparseVector>
%0 = linalg.generic #trait_vec_op
ins(%arga, %argb: tensor<?xf64, #SparseVector>, tensor<?xf64, #SparseVector>)
outs(%xv: tensor<?xf64, #SparseVector>) {
Expand All @@ -139,7 +139,7 @@ module {
func.func @vector_index(%arga: tensor<?xf64, #SparseVector>) -> tensor<?xi32, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xf64, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xi32, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xi32, #SparseVector>
%0 = linalg.generic #trait_vec_scale
ins(%arga: tensor<?xf64, #SparseVector>)
outs(%xv: tensor<?xi32, #SparseVector>) {
Expand All @@ -166,7 +166,7 @@ module {
%c1 = arith.constant 1 : index
%d0 = tensor.dim %arga, %c0 : tensor<?x?xf64, #DCSR>
%d1 = tensor.dim %arga, %c1 : tensor<?x?xf64, #DCSR>
%xv = bufferization.alloc_tensor(%d0, %d1) : tensor<?x?xf64, #DCSR>
%xv = tensor.empty(%d0, %d1) : tensor<?x?xf64, #DCSR>
%0 = linalg.generic #trait_mat_op
ins(%arga, %argb: tensor<?x?xf64, #DCSR>, tensor<?x?xf64, #DCSR>)
outs(%xv: tensor<?x?xf64, #DCSR>) {
Expand All @@ -191,7 +191,7 @@ module {
// Tensor addition (use semi-ring binary operation).
func.func @add_tensor_1(%A: tensor<4x4xf64, #DCSR>,
%B: tensor<4x4xf64, #DCSR>) -> tensor<4x4xf64, #DCSR> {
%C = bufferization.alloc_tensor() : tensor<4x4xf64, #DCSR>
%C = tensor.empty() : tensor<4x4xf64, #DCSR>
%0 = linalg.generic #trait_mat_op
ins(%A, %B: tensor<4x4xf64, #DCSR>,
tensor<4x4xf64, #DCSR>)
Expand All @@ -213,7 +213,7 @@ module {
// Same as @add_tensor_1, but use sparse_tensor.yield instead of identity to yield value.
func.func @add_tensor_2(%A: tensor<4x4xf64, #DCSR>,
%B: tensor<4x4xf64, #DCSR>) -> tensor<4x4xf64, #DCSR> {
%C = bufferization.alloc_tensor() : tensor<4x4xf64, #DCSR>
%C = tensor.empty() : tensor<4x4xf64, #DCSR>
%0 = linalg.generic #trait_mat_op
ins(%A, %B: tensor<4x4xf64, #DCSR>,
tensor<4x4xf64, #DCSR>)
Expand Down Expand Up @@ -241,7 +241,7 @@ module {
// Performs triangular add/sub operation (using semi-ring binary op).
func.func @triangular(%A: tensor<4x4xf64, #DCSR>,
%B: tensor<4x4xf64, #DCSR>) -> tensor<4x4xf64, #DCSR> {
%C = bufferization.alloc_tensor() : tensor<4x4xf64, #DCSR>
%C = tensor.empty() : tensor<4x4xf64, #DCSR>
%0 = linalg.generic #trait_mat_op
ins(%A, %B: tensor<4x4xf64, #DCSR>,
tensor<4x4xf64, #DCSR>)
Expand Down Expand Up @@ -274,7 +274,7 @@ module {
// Perform sub operation (using semi-ring binary op) with a constant threshold.
func.func @sub_with_thres(%A: tensor<4x4xf64, #DCSR>,
%B: tensor<4x4xf64, #DCSR>) -> tensor<4x4xf64, #DCSR> {
%C = bufferization.alloc_tensor() : tensor<4x4xf64, #DCSR>
%C = tensor.empty() : tensor<4x4xf64, #DCSR>
// Defines out-block constant bounds.
%thres_out_up = arith.constant 2.0 : f64
%thres_out_lo = arith.constant -2.0 : f64
Expand Down Expand Up @@ -323,7 +323,7 @@ module {
// Performs isEqual only on intersecting elements.
func.func @intersect_equal(%A: tensor<4x4xf64, #DCSR>,
%B: tensor<4x4xf64, #DCSR>) -> tensor<4x4xi8, #DCSR> {
%C = bufferization.alloc_tensor() : tensor<4x4xi8, #DCSR>
%C = tensor.empty() : tensor<4x4xi8, #DCSR>
%0 = linalg.generic #trait_mat_op
ins(%A, %B: tensor<4x4xf64, #DCSR>,
tensor<4x4xf64, #DCSR>)
Expand All @@ -346,7 +346,7 @@ module {
// Keeps values on left, negate value on right, ignore value when overlapping.
func.func @only_left_right(%A: tensor<4x4xf64, #DCSR>,
%B: tensor<4x4xf64, #DCSR>) -> tensor<4x4xf64, #DCSR> {
%C = bufferization.alloc_tensor() : tensor<4x4xf64, #DCSR>
%C = tensor.empty() : tensor<4x4xf64, #DCSR>
%0 = linalg.generic #trait_mat_op
ins(%A, %B: tensor<4x4xf64, #DCSR>,
tensor<4x4xf64, #DCSR>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module {

func.func @cmp_lhs_sparse(%arga: tensor<4x4xf64, #DCSR>,
%argb: tensor<4x4xf64>) -> tensor<4x4xi8, #DCSR> {
%argx = bufferization.alloc_tensor() : tensor<4x4xi8, #DCSR>
%argx = tensor.empty() : tensor<4x4xi8, #DCSR>
%0 = linalg.generic #trait
ins(%arga, %argb: tensor<4x4xf64, #DCSR>, tensor<4x4xf64>)
outs(%argx: tensor<4x4xi8, #DCSR>) {
Expand All @@ -80,7 +80,7 @@ module {

func.func @cmp_all_sparse(%arga: tensor<4x4xf64, #DCSR>,
%argb: tensor<4x4xf64, #DCSR>) -> tensor<4x4xi8, #DCSR> {
%argx = bufferization.alloc_tensor() : tensor<4x4xi8, #DCSR>
%argx = tensor.empty() : tensor<4x4xi8, #DCSR>
%0 = linalg.generic #trait
ins(%arga, %argb: tensor<4x4xf64, #DCSR>, tensor<4x4xf64, #DCSR>)
outs(%argx: tensor<4x4xi8, #DCSR>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module {
%c1 = arith.constant 1 : index
%c2 = arith.constant 2 : index
%c3 = arith.constant 3 : index
%t1 = bufferization.alloc_tensor() : tensor<4x5xf64, #DCSR>
%t2 = bufferization.alloc_tensor(%c2, %c3) : tensor<?x?xf64, #DCSR>
%t1 = tensor.empty() : tensor<4x5xf64, #DCSR>
%t2 = tensor.empty(%c2, %c3) : tensor<?x?xf64, #DCSR>

%d1_0 = tensor.dim %t1, %c0 : tensor<4x5xf64, #DCSR>
%d2_0 = tensor.dim %t2, %c0 : tensor<?x?xf64, #DCSR>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module {
-> tensor<?xcomplex<f32>, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xcomplex<f32>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f32>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f32>, #SparseVector>
%0 = linalg.generic #trait_op
ins(%arga, %argb: tensor<?xcomplex<f32>, #SparseVector>,
tensor<?xcomplex<f32>, #SparseVector>)
Expand All @@ -65,7 +65,7 @@ module {
-> tensor<?xcomplex<f32>, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xcomplex<f32>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f32>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f32>, #SparseVector>
%0 = linalg.generic #trait_op
ins(%arga, %argb: tensor<?xcomplex<f32>, #SparseVector>,
tensor<?xcomplex<f32>, #SparseVector>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op
ins(%arga, %argb: tensor<?xcomplex<f64>, #SparseVector>,
tensor<?xcomplex<f64>, #SparseVector>)
Expand All @@ -62,7 +62,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c = arith.constant 0 : index
%d = tensor.dim %arga, %c : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op
ins(%arga, %argb: tensor<?xcomplex<f64>, #SparseVector>,
tensor<?xcomplex<f64>, #SparseVector>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op2
ins(%arga, %argb: tensor<?xcomplex<f64>, #SparseVector>,
tensor<?xcomplex<f64>, #SparseVector>)
Expand All @@ -74,7 +74,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op1
ins(%arga: tensor<?xcomplex<f64>, #SparseVector>)
outs(%xv: tensor<?xcomplex<f64>, #SparseVector>) {
Expand All @@ -89,7 +89,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op1
ins(%arga: tensor<?xcomplex<f64>, #SparseVector>)
outs(%xv: tensor<?xcomplex<f64>, #SparseVector>) {
Expand All @@ -104,7 +104,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op1
ins(%arga: tensor<?xcomplex<f64>, #SparseVector>)
outs(%xv: tensor<?xcomplex<f64>, #SparseVector>) {
Expand All @@ -119,7 +119,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%0 = linalg.generic #trait_op1
ins(%arga: tensor<?xcomplex<f64>, #SparseVector>)
outs(%xv: tensor<?xcomplex<f64>, #SparseVector>) {
Expand All @@ -135,7 +135,7 @@ module {
-> tensor<?xcomplex<f64>, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xcomplex<f64>, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xcomplex<f64>, #SparseVector>
%c = complex.constant [2.0 : f64, 0.0 : f64] : complex<f64>
%0 = linalg.generic #trait_op1
ins(%arga: tensor<?xcomplex<f64>, #SparseVector>)
Expand All @@ -151,7 +151,7 @@ module {
-> tensor<?xf64, #SparseVector> {
%c0 = arith.constant 0 : index
%d = tensor.dim %arga, %c0 : tensor<?xcomplex<f64>, #SparseVector>
%xv = bufferization.alloc_tensor(%d) : tensor<?xf64, #SparseVector>
%xv = tensor.empty(%d) : tensor<?xf64, #SparseVector>
%0 = linalg.generic #trait_op1
ins(%arga: tensor<?xcomplex<f64>, #SparseVector>)
outs(%xv: tensor<?xf64, #SparseVector>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

// Creates and returns 3-D buffer of size (%s1, %s2, %s3) filled with the value %f
func.func @alloc_3d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %f : f32) -> tensor<?x?x?xf32> {
%buf = bufferization.alloc_tensor(%s1, %s2, %s3) : tensor<?x?x?xf32>
%buf = tensor.empty(%s1, %s2, %s3) : tensor<?x?x?xf32>
%ret = linalg.fill ins(%f : f32) outs(%buf : tensor<?x?x?xf32>) -> tensor<?x?x?xf32>
return %ret : tensor<?x?x?xf32>
}
Expand All @@ -58,7 +58,7 @@ func.func @conv_1d_nwc_wcf_CCC(%arg0: tensor<?x?x?xf32, #CCC>, %arg1: tensor<?x?
%c1 = arith.constant 1 : index
%c3 = arith.constant 3 : index
%c6 = arith.constant 6 : index
%s = bufferization.alloc_tensor(%c3, %c6, %c1) : tensor<?x?x?xf32, #CCC>
%s = tensor.empty(%c3, %c6, %c1) : tensor<?x?x?xf32, #CCC>
%ret = linalg.conv_1d_nwc_wcf {dilations = dense<1> : tensor<1xi64>,
strides = dense<1> : tensor<1xi64>}
ins (%arg0, %arg1: tensor<?x?x?xf32, #CCC>, tensor<?x?x?xf32>)
Expand All @@ -70,7 +70,7 @@ func.func @conv_1d_nwc_wcf_CDC(%arg0: tensor<?x?x?xf32, #CDC>, %arg1: tensor<?x?
%c1 = arith.constant 1 : index
%c3 = arith.constant 3 : index
%c6 = arith.constant 6 : index
%s = bufferization.alloc_tensor(%c3, %c6, %c1) : tensor<?x?x?xf32, #CDC>
%s = tensor.empty(%c3, %c6, %c1) : tensor<?x?x?xf32, #CDC>
%ret = linalg.conv_1d_nwc_wcf {dilations = dense<1> : tensor<1xi64>,
strides = dense<1> : tensor<1xi64>}
ins (%arg0, %arg1: tensor<?x?x?xf32, #CDC>, tensor<?x?x?xf32>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module {

func.func @conv2d_sparse_out(%input: tensor<8x8xi32>,
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #DCSR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #DCSR>
%s = tensor.empty() : tensor<6x6xi32, #DCSR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32>, tensor<3x3xi32>)
outs (%s: tensor<6x6xi32, #DCSR>) -> tensor<6x6xi32, #DCSR>
Expand All @@ -60,7 +60,7 @@ module {

func.func @conv2d_all_sparse_DCSR(%input: tensor<8x8xi32, #DCSR>,
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #DCSR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #DCSR>
%s = tensor.empty() : tensor<6x6xi32, #DCSR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #DCSR>, tensor<3x3xi32>)
outs (%s: tensor<6x6xi32, #DCSR>) -> tensor<6x6xi32, #DCSR>
Expand All @@ -69,7 +69,7 @@ module {

func.func @conv2d_all_sparse_CSR(%input: tensor<8x8xi32, #CSR>,
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CSR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #CSR>
%s = tensor.empty() : tensor<6x6xi32, #CSR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #CSR>, tensor<3x3xi32>)
outs (%s: tensor<6x6xi32, #CSR>) -> tensor<6x6xi32, #CSR>
Expand All @@ -78,7 +78,7 @@ module {

func.func @conv2d_all_sparse_CD(%input: tensor<8x8xi32, #CDR>,
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CDR> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #CDR>
%s = tensor.empty() : tensor<6x6xi32, #CDR>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #CDR>, tensor<3x3xi32>)
outs (%s: tensor<6x6xi32, #CDR>) -> tensor<6x6xi32, #CDR>
Expand All @@ -87,7 +87,7 @@ module {

func.func @conv2d_all_sparse_CSC(%input: tensor<8x8xi32, #CSC>,
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CSC> {
%s = bufferization.alloc_tensor() : tensor<6x6xi32, #CSC>
%s = tensor.empty() : tensor<6x6xi32, #CSC>
%0 = linalg.conv_2d
ins (%input, %filter: tensor<8x8xi32, #CSC>, tensor<3x3xi32>)
outs (%s: tensor<6x6xi32, #CSC>) -> tensor<6x6xi32, #CSC>
Expand Down
Loading