diff options
author | wren romano <2998727+wrengr@users.noreply.github.com> | 2023-05-22 16:07:48 -0700 |
---|---|---|
committer | wren romano <2998727+wrengr@users.noreply.github.com> | 2023-05-22 18:42:31 -0700 |
commit | 54c87f216c6247c48e082b9597778e720e51d544 (patch) | |
tree | 6d75c1b5db2cbd1a7468a413b1057f4fbd9f7a4b | |
parent | fa2827f0796c08e36b0b157fc526dd59cd6368e3 (diff) | |
download | llvm-54c87f216c6247c48e082b9597778e720e51d544.zip llvm-54c87f216c6247c48e082b9597778e720e51d544.tar.gz llvm-54c87f216c6247c48e082b9597778e720e51d544.tar.bz2 |
[mlir][sparse] (NFC) Reordering extraClassDeclaration for STEA
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D151171
-rw-r--r-- | mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td index d3cbb29..adfdc48 100644 --- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td +++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td @@ -293,15 +293,9 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding", ]; let extraClassDeclaration = [{ - /// Returns the type for position storage based on posWidth. - /// Asserts that the encoding is non-null (since there's nowhere - /// to get the `MLIRContext` from). - Type getPosType() const; - - /// Returns the type for coordinate storage based on crdWidth. - /// Asserts that the encoding is non-null (since there's nowhere - /// to get the `MLIRContext` from). - Type getCrdType() const; + // + // Factory methods. + // /// Constructs a new encoding with the dimOrdering and higherOrdering /// reset to the default/identity. @@ -311,18 +305,9 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding", /// reset to the default. SparseTensorEncodingAttr withoutBitWidths() const; - /// Returns true if every level is dense. Also returns true for - /// the null encoding (since dense-tensors are always all-dense). - bool isAllDense() const; - - /// Returns true if every level is ordered. Also returns true for - /// the null encoding (since dense-tensors are always all-ordered). - bool isAllOrdered() const; - - /// Returns true if the encoding has an identity dimension ordering. - /// Also returns true for the null encoding (since dense-tensors - /// always have the identity ordering). - bool hasIdDimOrdering() const; + // + // lvlTypes methods. + // /// Returns the number of storage levels. Asserts that the encoding /// is non-null (since there is no fixed result that's valid for @@ -341,6 +326,41 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding", bool isOrderedLvl(::mlir::sparse_tensor::Level l) const { return isOrderedDLT(getLvlType(l)); } bool isUniqueLvl(::mlir::sparse_tensor::Level l) const { return isUniqueDLT(getLvlType(l)); } + /// Returns true if every level is dense. Also returns true for + /// the null encoding (since dense-tensors are always all-dense). + bool isAllDense() const; + + /// Returns true if every level is ordered. Also returns true for + /// the null encoding (since dense-tensors are always all-ordered). + bool isAllOrdered() const; + + // + // dimOrdering/higherOrdering methods. + // + + /// Returns true if the encoding has an identity dimension ordering. + /// Also returns true for the null encoding (since dense-tensors + /// always have the identity ordering). + bool hasIdDimOrdering() const; + + // + // posWidth/crdWidth methods. + // + + /// Returns the type for position storage based on posWidth. + /// Asserts that the encoding is non-null (since there's nowhere + /// to get the `MLIRContext` from). + Type getPosType() const; + + /// Returns the type for coordinate storage based on crdWidth. + /// Asserts that the encoding is non-null (since there's nowhere + /// to get the `MLIRContext` from). + Type getCrdType() const; + + // + // dimSlices methods. + // + bool isSlice() const; ::mlir::sparse_tensor::SparseTensorDimSliceAttr getDimSlice(::mlir::sparse_tensor::Dimension dim) const; |