MLIR
20.0.0git
|
Options to use to control tiling. More...
#include "mlir/Dialect/SCF/Transforms/TileUsingInterface.h"
Public Types | |
enum class | LoopType { ForOp , ForallOp } |
Specify which loop construct to use for tile and fuse. More... | |
Public Member Functions | |
SCFTilingOptions & | setTileSizeComputationFunction (SCFTileSizeComputationFunction fun) |
SCFTilingOptions & | setTileSizes (ArrayRef< OpFoldResult > tileSizes) |
Convenience function to set the tileSizeComputationFunction to a function that computes tile sizes at the point they are needed. More... | |
SCFTilingOptions & | setNumThreadsComputationFunction (SCFTileSizeComputationFunction fun) |
SCFTilingOptions & | setNumThreads (ArrayRef< OpFoldResult > numThreads) |
Convenience function to set the numThreadsComputationFunction to a function that computes num threads at the point they are needed. More... | |
SCFTilingOptions & | setInterchange (ArrayRef< int64_t > interchange) |
SCFTilingOptions & | setLoopType (LoopType type) |
SCFTilingOptions & | setMapping (ArrayRef< Attribute > mapping) |
Public Attributes | |
SCFTileSizeComputationFunction | tileSizeComputationFunction = nullptr |
Computation function that returns the tile sizes to use for each loop. More... | |
SCFTileSizeComputationFunction | numThreadsComputationFunction = nullptr |
Computation function that returns the number of threads to use for each loop. More... | |
SmallVector< int64_t > | interchangeVector = {} |
The interchange vector to reorder the tiled loops. More... | |
LoopType | loopType = LoopType::ForOp |
SmallVector< Attribute > | mappingVector = {} |
Specify mapping of loops to devices. More... | |
Options to use to control tiling.
Definition at line 35 of file TileUsingInterface.h.
|
strong |
Specify which loop construct to use for tile and fuse.
Enumerator | |
---|---|
ForOp | |
ForallOp |
Definition at line 81 of file TileUsingInterface.h.
|
inline |
Definition at line 75 of file TileUsingInterface.h.
References interchangeVector.
|
inline |
Definition at line 83 of file TileUsingInterface.h.
References loopType.
|
inline |
Definition at line 93 of file TileUsingInterface.h.
References mappingVector.
scf::SCFTilingOptions & scf::SCFTilingOptions::setNumThreads | ( | ArrayRef< OpFoldResult > | numThreads | ) |
Convenience function to set the numThreadsComputationFunction
to a function that computes num threads at the point they are needed.
Definition at line 50 of file TileUsingInterface.cpp.
|
inline |
Definition at line 65 of file TileUsingInterface.h.
References numThreadsComputationFunction.
|
inline |
Definition at line 44 of file TileUsingInterface.h.
References tileSizeComputationFunction.
scf::SCFTilingOptions & scf::SCFTilingOptions::setTileSizes | ( | ArrayRef< OpFoldResult > | tileSizes | ) |
Convenience function to set the tileSizeComputationFunction
to a function that computes tile sizes at the point they are needed.
Allows proper interaction with folding.
Definition at line 40 of file TileUsingInterface.cpp.
References tileSizeComputationFunction.
SmallVector<int64_t> mlir::scf::SCFTilingOptions::interchangeVector = {} |
The interchange vector to reorder the tiled loops.
Definition at line 74 of file TileUsingInterface.h.
Referenced by setInterchange().
LoopType mlir::scf::SCFTilingOptions::loopType = LoopType::ForOp |
Definition at line 82 of file TileUsingInterface.h.
Referenced by setLoopType().
SmallVector<Attribute> mlir::scf::SCFTilingOptions::mappingVector = {} |
Specify mapping of loops to devices.
This is only respected when the loop constructs support such a mapping (like scf.forall
). Will be ignored when using loop constructs that dont support such a mapping (like scf.for
)
Definition at line 92 of file TileUsingInterface.h.
Referenced by setMapping().
SCFTileSizeComputationFunction mlir::scf::SCFTilingOptions::numThreadsComputationFunction = nullptr |
Computation function that returns the number of threads to use for each loop.
Returning a num threads of zero implies no tiling for that loop. If the size of the returned vector is smaller than the number of loops, the inner loops are not tiled. If the size of the returned vector is larger, then the vector is truncated to number of loops. Note: This option is only supported with loopType set to LoopType::ForallOp
. If the tile size function is not specified while the num threads computation is, then the tile size is determined automatically to map at most one tile per thread.
Definition at line 62 of file TileUsingInterface.h.
Referenced by setNumThreadsComputationFunction().
SCFTileSizeComputationFunction mlir::scf::SCFTilingOptions::tileSizeComputationFunction = nullptr |
Computation function that returns the tile sizes to use for each loop.
Returning a tile size of zero implies no tiling for that loop. If the size of the returned vector is smaller than the number of loops, the inner loops are not tiled. If the size of the returned vector is larger, then the vector is truncated to number of loops.
Definition at line 41 of file TileUsingInterface.h.
Referenced by setTileSizeComputationFunction(), and setTileSizes().