Skip to content

Commit b8e0983

Browse files
Peiming LiuPeimingLiu
authored andcommitted
revert unintended change
1 parent 398599f commit b8e0983

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorLevel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ using ValueTuple = std::tuple<Value, Value, Value>;
4545
//===----------------------------------------------------------------------===//
4646

4747
namespace {
48+
4849
class SparseLevel : public SparseTensorLevel {
4950
public:
5051
SparseLevel(unsigned tid, Level lvl, LevelType lt, Value lvlSize,
@@ -201,6 +202,7 @@ static Value offsetFromMinCrd(OpBuilder &b, Location l, Value minCrd,
201202
//===----------------------------------------------------------------------===//
202203
// SparseIterator derived classes.
203204
//===----------------------------------------------------------------------===//
205+
204206
namespace {
205207

206208
// The iterator that traverses a concrete sparse tensor levels. High-level

mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorLevel.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,20 @@ class SparseIterator {
136136
//
137137

138138
// Whether the iterator support random access (i.e., support look up by
139-
// *coordinate*). A random access iterator must also traverses a dense
140-
// space.
139+
// *coordinate*). A random access iterator must also traverses a dense space.
141140
virtual bool randomAccessible() const = 0;
142141

143142
// Whether the iterator can simply traversed by a for loop.
144143
virtual bool iteratableByFor() const { return false; };
145144

146-
// Get the upper bound of the sparse space that the iterator might visited.
147-
// A sparse space is a subset of a dense space [0, bound), this function
148-
// returns *bound*.
145+
// Get the upper bound of the sparse space that the iterator might visited. A
146+
// sparse space is a subset of a dense space [0, bound), this function returns
147+
// *bound*.
149148
virtual Value upperBound(OpBuilder &b, Location l) const = 0;
150149

151-
// Serializes and deserializes the current status to/from a set of values.
152-
// The ValueRange should contain values that are sufficient to recover the
153-
// current iterating postion (i.e., itVals) as well as loop bound.
150+
// Serializes and deserializes the current status to/from a set of values. The
151+
// ValueRange should contain values that are sufficient to recover the current
152+
// iterating postion (i.e., itVals) as well as loop bound.
154153
//
155154
// Not every type of iterator supports the operations, e.g., non-empty
156155
// subsection iterator does not because the the number of non-empty
@@ -227,8 +226,8 @@ class SparseIterator {
227226
// yield it
228227
//
229228
// The function is virtual to allow alternative implementation. For example,
230-
// if it.next() is trivial to compute, we can use a select operation
231-
// instead. E.g.,
229+
// if it.next() is trivial to compute, we can use a select operation instead.
230+
// E.g.,
232231
//
233232
// it = select cond ? it+1 : it
234233
virtual ValueRange forwardIf(OpBuilder &b, Location l, Value cond);
@@ -260,12 +259,12 @@ class SparseIterator {
260259
// A range of value that together defines the current state of the
261260
// iterator. Only loop variants should be included.
262261
//
263-
// For trivial iterators, it is the position; for dedup iterators, it
264-
// consists of the positon and the segment high, for non-empty subsection
265-
// iterator, it is the metadata that specifies the subsection. Note that the
266-
// wrapped iterator shares the same storage to maintain itVals with it
267-
// wrapper, which means the wrapped iterator might only own a subset of all
268-
// the values stored in itValStorage.
262+
// For trivial iterators, it is the position; for dedup iterators, it consists
263+
// of the positon and the segment high, for non-empty subsection iterator, it
264+
// is the metadata that specifies the subsection.
265+
// Note that the wrapped iterator shares the same storage to maintain itVals
266+
// with it wrapper, which means the wrapped iterator might only own a subset
267+
// of all the values stored in itValStorage.
269268
const unsigned cursorValsCnt;
270269
SmallVectorImpl<Value> &cursorValsStorageRef;
271270
};

0 commit comments

Comments
 (0)