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();
48
48
// / ops.
49
49
std::unique_ptr<OperationPass<func::FuncOp>> createAffineParallelizePass ();
50
50
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
+
51
56
// / Apply normalization transformations to affine loop-like ops. If
52
57
// / `promoteSingleIter` is true, single iteration loops are promoted (i.e., the
53
58
// / loop is replaced by its loop body).
Original file line number Diff line number Diff line change @@ -42,6 +42,14 @@ namespace {
42
42
// / Convert all parallel affine.for op into 1-D affine.parallel op.
43
43
struct AffineParallelize
44
44
: 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
+
45
53
void runOnOperation () override ;
46
54
};
47
55
@@ -95,3 +103,9 @@ std::unique_ptr<OperationPass<func::FuncOp>>
95
103
mlir::affine::createAffineParallelizePass () {
96
104
return std::make_unique<AffineParallelize>();
97
105
}
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