AffineLoops = 1,
ParallelLoops = 2,
};
+
using TileSizeComputationFunction =
std::function<SmallVector<Value, 4>(OpBuilder &, Operation *)>;
+
struct LinalgTilingOptions {
/// Computation function that returns the tile sizes for each operation.
/// Delayed construction of constant tile sizes should occur to interoperate
/// with folding.
TileSizeComputationFunction tileSizeComputationFunction = nullptr;
+
LinalgTilingOptions &
- setTileSizeComputationFunction(TileSizeComputationFunction &fun) {
- tileSizeComputationFunction = fun;
+ setTileSizeComputationFunction(TileSizeComputationFunction fun) {
+ tileSizeComputationFunction = std::move(fun);
return *this;
}
/// Set the `tileSizeComputationFunction` to return the values `ts`. The
LinalgTilingOptions &setTileSizes(ArrayRef<int64_t> ts);
/// The interchange vector to reorder the tiled loops.
- SmallVector<unsigned, 4> interchangeVector{};
+ SmallVector<unsigned, 4> interchangeVector = {};
+
LinalgTilingOptions &setInterchange(ArrayRef<unsigned> interchange) {
interchangeVector.assign(interchange.begin(), interchange.end());
return *this;
}
+
/// The type of tile loops to generate.
- LinalgTilingLoopType loopType{LinalgTilingLoopType::Loops};
+ LinalgTilingLoopType loopType = LinalgTilingLoopType::Loops;
+
LinalgTilingOptions &setLoopType(LinalgTilingLoopType lt) {
loopType = lt;
return *this;
/// When specified, specifies distribution of generated tile loops to
/// processors.
Optional<LinalgLoopDistributionOptions> distribution = None;
+
LinalgTilingOptions &
- setDistributionOptions(LinalgLoopDistributionOptions &distributionOptions) {
- distribution = distributionOptions;
+ setDistributionOptions(LinalgLoopDistributionOptions distributionOptions) {
+ distribution = std::move(distributionOptions);
return *this;
}
};