File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
include/mlir/Dialect/Affine
lib/Dialect/Affine/Transforms Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ createAffineLoopInvariantCodeMotionPass();
4848// / ops.
4949std::unique_ptr<OperationPass<func::FuncOp>> createAffineParallelizePass ();
5050
51+ // / Creates a pass to convert all parallel affine.for's into 1-d affine.parallel
52+ // / ops using the specified parallelize options.
53+ std::unique_ptr<OperationPass<func::FuncOp>>
54+ createAffineParallelizePass (const AffineParallelizeOptions &options);
55+
5156// / Apply normalization transformations to affine loop-like ops. If
5257// / `promoteSingleIter` is true, single iteration loops are promoted (i.e., the
5358// / loop is replaced by its loop body).
Original file line number Diff line number Diff line change @@ -42,6 +42,14 @@ namespace {
4242// / Convert all parallel affine.for op into 1-D affine.parallel op.
4343struct AffineParallelize
4444 : public affine::impl::AffineParallelizeBase<AffineParallelize> {
45+
46+ AffineParallelize () = default ;
47+
48+ explicit AffineParallelize (const AffineParallelizeOptions &options) {
49+ maxNested = std::move (options.maxNested );
50+ parallelReductions = std::move (options.parallelReductions );
51+ }
52+
4553 void runOnOperation () override ;
4654};
4755
@@ -95,3 +103,9 @@ std::unique_ptr<OperationPass<func::FuncOp>>
95103mlir::affine::createAffineParallelizePass () {
96104 return std::make_unique<AffineParallelize>();
97105}
106+
107+ std::unique_ptr<OperationPass<func::FuncOp>>
108+ mlir::affine::createAffineParallelizePass (
109+ const AffineParallelizeOptions &options) {
110+ return std::make_unique<AffineParallelize>(options);
111+ }
You can’t perform that action at this time.
0 commit comments