Skip to content

Commit dbe1be9

Browse files
[mlir][sparse] Migrate tests to use new syntax (#66146)
lvlTypes = [ "compressed" ] to map = (d0) -> (d0 : compressed) lvlTypes = [ "dense" ] to map = (d0) -> (d0 : dense)
1 parent d25b4fa commit dbe1be9

File tree

64 files changed

+112
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+112
-112
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
194194
```mlir
195195
// Sparse vector.
196196
#SparseVector = #sparse_tensor.encoding<{
197-
lvlTypes = [ "compressed" ]
197+
map = (d0) -> (d0 : compressed)
198198
}>
199199
... tensor<?xf32, #SparseVector> ...
200200

mlir/test/Dialect/SparseTensor/codegen.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: mlir-opt %s --sparse-tensor-codegen --canonicalize -cse | FileCheck %s
22

3-
#SV = #sparse_tensor.encoding<{ lvlTypes = [ "compressed" ] }>
3+
#SV = #sparse_tensor.encoding<{ map = (d0) -> (d0 : compressed) }>
44

55
#SparseVector = #sparse_tensor.encoding<{
6-
lvlTypes = [ "compressed" ],
6+
map = (d0) -> (d0 : compressed),
77
crdWidth = 64,
88
posWidth = 32
99
}>

mlir/test/Dialect/SparseTensor/codegen_buffer_initialization.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: mlir-opt %s --sparse-tensor-codegen=enable-buffer-initialization=true --canonicalize --cse | FileCheck %s
22

3-
#SV = #sparse_tensor.encoding<{ lvlTypes = [ "compressed" ] }>
3+
#SV = #sparse_tensor.encoding<{ map = (d0) -> (d0 : compressed) }>
44

55
// CHECK-LABEL: func.func @sparse_alloc_sparse_vector(
66
// CHECK-SAME: %[[VAL_0:.*]]: index) -> (memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier

mlir/test/Dialect/SparseTensor/codegen_to_llvm.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: mlir-opt %s --sparse-tensor-codegen --sparse-storage-specifier-to-llvm | FileCheck %s
22

3-
#SparseVector = #sparse_tensor.encoding<{ lvlTypes = ["compressed"] }>
3+
#SparseVector = #sparse_tensor.encoding<{ map = (d0) -> (d0 : compressed) }>
44

55
// CHECK-LABEL: func @sparse_nop(
66
// CHECK-SAME: %[[A0:.*0]]: memref<?xindex>,

mlir/test/Dialect/SparseTensor/constant_index_map.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#map1 = affine_map<(d0) -> (0, d0)>
66
#map2 = affine_map<(d0) -> (d0)>
77

8-
#SpVec = #sparse_tensor.encoding<{ lvlTypes = [ "compressed" ] }>
8+
#SpVec = #sparse_tensor.encoding<{ map = (d0) -> (d0 : compressed) }>
99

1010
// CHECK-LABEL: func.func @main(
1111
// CHECK-SAME: %[[VAL_0:.*0]]: tensor<1x77xi1>,

mlir/test/Dialect/SparseTensor/conversion.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// RUN: mlir-opt %s --sparse-tensor-conversion --canonicalize --cse | FileCheck %s
22

33
#SparseVector = #sparse_tensor.encoding<{
4-
lvlTypes = ["compressed"]
4+
map = (d0) -> (d0 : compressed)
55
}>
66

77
#SparseVector64 = #sparse_tensor.encoding<{
8-
lvlTypes = ["compressed"],
8+
map = (d0) -> (d0 : compressed),
99
posWidth = 64,
1010
crdWidth = 64
1111
}>
1212

1313
#SparseVector32 = #sparse_tensor.encoding<{
14-
lvlTypes = ["compressed"],
14+
map = (d0) -> (d0 : compressed),
1515
posWidth = 32,
1616
crdWidth = 32
1717
}>

mlir/test/Dialect/SparseTensor/convert_dense2sparse.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: --canonicalize --cse | FileCheck %s --check-prefix=CHECK-RWT
44

55
#SparseVector = #sparse_tensor.encoding<{
6-
lvlTypes = ["compressed"]
6+
map = (d0) -> (d0 : compressed)
77
}>
88

99
#CSR = #sparse_tensor.encoding<{

mlir/test/Dialect/SparseTensor/convert_sparse2dense.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: --canonicalize --cse | FileCheck %s --check-prefix=CHECK-RWT
55

66
#SparseVector = #sparse_tensor.encoding<{
7-
lvlTypes = ["compressed"]
7+
map = (d0) -> (d0 : compressed)
88
}>
99

1010
#SparseMatrix = #sparse_tensor.encoding<{

mlir/test/Dialect/SparseTensor/convert_sparse2sparse.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
// RUN: --canonicalize --cse | FileCheck %s --check-prefix=CHECK-RWT
1111

1212
#SparseVector64 = #sparse_tensor.encoding<{
13-
lvlTypes = ["compressed"],
13+
map = (d0) -> (d0 : compressed),
1414
posWidth = 64,
1515
crdWidth = 64
1616
}>
1717

1818
#SparseVector32 = #sparse_tensor.encoding<{
19-
lvlTypes = ["compressed"],
19+
map = (d0) -> (d0 : compressed),
2020
posWidth = 32,
2121
crdWidth = 32
2222
}>
2323

2424
#SparseVector = #sparse_tensor.encoding<{
25-
lvlTypes = ["compressed"]
25+
map = (d0) -> (d0 : compressed)
2626
}>
2727

2828
#SortedCOO2D = #sparse_tensor.encoding<{

mlir/test/Dialect/SparseTensor/convert_sparse2sparse_element.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: mlir-opt %s --sparse-tensor-codegen --canonicalize --cse | FileCheck %s
22

33
#SparseVector64 = #sparse_tensor.encoding<{
4-
lvlTypes = ["compressed"],
4+
map = (d0) -> (d0 : compressed),
55
posWidth = 64,
66
crdWidth = 64
77
}>
88

99
#SparseVector32 = #sparse_tensor.encoding<{
10-
lvlTypes = ["compressed"],
10+
map = (d0) -> (d0 : compressed),
1111
posWidth = 32,
1212
crdWidth = 32
1313
}>

0 commit comments

Comments
 (0)