MLIR
20.0.0git
|
A range-style iterator that allows for iterating over the offsets of all potential tiles of size tileShape
within the larger shape shape
, using an ordering specified by loopOrder
.
More...
#include "mlir/Dialect/Utils/IndexingUtils.h"
Public Types | |
using | IteratorTy = detail::TileOffsetRangeIterator< int64_t > |
using | ParamsTy = detail::TileOffsetRangeImpl |
Public Member Functions | |
StaticTileOffsetRange (ArrayRef< int64_t > shape, ArrayRef< int64_t > tileShape, ArrayRef< int64_t > loopOrder) | |
StaticTileOffsetRange (ArrayRef< int64_t > shape, ArrayRef< int64_t > tileShape) | |
Create the range with identity loop order. More... | |
IteratorTy | begin () const |
IteratorTy | end () const |
size_t | size () const |
Returns the total number of tiles that fit in the larger shape. More... | |
size_t | getRank () const |
Returns rank of the iterator's shape. More... | |
A range-style iterator that allows for iterating over the offsets of all potential tiles of size tileShape
within the larger shape shape
, using an ordering specified by loopOrder
.
The loopOrder
specifies the order of unrolling by numbering the dimensions in order from "outer most for loop" (slowest changing) to "inner most for loop" (fastest changing).
For example, for shape = {10, 20, 30}
, tileShape = {5, 10, 15}
, and loopOrder={2, 0, 1}
, the iterating over this range will yield offsets:
This is useful in contexts where a vector computation over a larger shape needs to be unrolled to a set of operations on subsets of the original operands, such as during the "vector unrolling" transformations.
The size of tileShape
must be less-than-or-equal-to the size of shape
.a If the rank of tileShape
is smaller than shape
, then tileShape
elements correspond to the trailing dimensions of shape
, and the leading dimensions are considered untiled and tileShape
is effectively prepended with the leading dims of shape
.
Definition at line 376 of file IndexingUtils.h.
using mlir::StaticTileOffsetRange::IteratorTy = detail::TileOffsetRangeIterator<int64_t> |
Definition at line 378 of file IndexingUtils.h.
Definition at line 379 of file IndexingUtils.h.
|
inline |
Definition at line 381 of file IndexingUtils.h.
|
inline |
Create the range with identity loop order.
Definition at line 390 of file IndexingUtils.h.
|
inline |
Definition at line 398 of file IndexingUtils.h.
|
inline |
Definition at line 399 of file IndexingUtils.h.
|
inline |
Returns rank of the iterator's shape.
Definition at line 405 of file IndexingUtils.h.
References mlir::detail::TileOffsetRangeImpl::getRank().
|
inline |
Returns the total number of tiles that fit in the larger shape.
Definition at line 402 of file IndexingUtils.h.
References mlir::detail::TileOffsetRangeImpl::getMaxLinearIndex().