[Mlir-commits] [mlir] 54c87f2 - [mlir][sparse] (NFC) Reordering extraClassDeclaration for STEA
wren romano
llvmlistbot at llvm.org
Mon May 22 18:42:39 PDT 2023
Author: wren romano
Date: 2023-05-22T18:42:31-07:00
New Revision: 54c87f216c6247c48e082b9597778e720e51d544
URL: https://github.com/llvm/llvm-project/commit/54c87f216c6247c48e082b9597778e720e51d544
DIFF: https://github.com/llvm/llvm-project/commit/54c87f216c6247c48e082b9597778e720e51d544.diff
LOG: [mlir][sparse] (NFC) Reordering extraClassDeclaration for STEA
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D151171
Added:
Modified:
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
index d3cbb297cc41e..adfdc48014902 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;
More information about the Mlir-commits
mailing list