|
MLIR 22.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. | |
| IteratorTy | begin () const |
| IteratorTy | end () const |
| size_t | size () const |
| Returns the total number of tiles that fit in the larger shape. | |
| size_t | getRank () const |
| Returns rank of the iterator's shape. | |
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.
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.
References size().
|
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.
|
inline |
Returns the total number of tiles that fit in the larger shape.
Definition at line 402 of file IndexingUtils.h.
Referenced by StaticTileOffsetRange().