Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
change builder func
  • Loading branch information
Butygin
Butygin committed Feb 28, 2021
commit 42d25463e918bac5f9972af3efa5ee39ff6f4160
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct ParallelToTbb : public mlir::OpRewritePattern<mlir::scf::ParallelOp>
auto orig_lower_bound = op.lowerBound().front();
auto orig_upper_bound = op.upperBound().front();
auto orig_step = op.step().front();
auto body_builder = [&](mlir::OpBuilder &builder, ::mlir::Location loc, mlir::Value lower_bound, mlir::Value upper_bound, mlir::Value thread_index)
auto body_builder = [&](mlir::OpBuilder &builder, ::mlir::Location loc, mlir::ValueRange lower_bound, mlir::ValueRange upper_bound, mlir::Value thread_index)
{
llvm::SmallVector<mlir::Value> initVals(op.initVals().size());
for (auto it : llvm::enumerate(op.initVals()))
Expand Down
2 changes: 1 addition & 1 deletion mlir-compiler/plier/include/plier/PlierOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def ParallelOp : Plier_Op<"parallel",
let skipDefaultBuilders = 1;
let builders = [
OpBuilderDAG<(ins "::mlir::Value":$lowerBound, "::mlir::Value":$upperBound, "::mlir::Value":$step,
CArg<"::mlir::function_ref<void(::mlir::OpBuilder &, ::mlir::Location, ::mlir::Value, ::mlir::Value, ::mlir::Value)>",
CArg<"::mlir::function_ref<void(::mlir::OpBuilder &, ::mlir::Location, ::mlir::ValueRange, ::mlir::ValueRange, ::mlir::Value)>",
"nullptr">)>
];
}
Expand Down
4 changes: 2 additions & 2 deletions mlir-compiler/plier/src/dialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ bool ParallelOp::isDefinedOutsideOfLoop(mlir::Value value)
void ParallelOp::build(
mlir::OpBuilder &odsBuilder, mlir::OperationState &odsState,
mlir::Value lowerBound, mlir::Value upperBound, mlir::Value step,
mlir::function_ref<void(mlir::OpBuilder &, mlir::Location, mlir::Value,
mlir::Value, mlir::Value)> bodyBuilder) {
mlir::function_ref<void(mlir::OpBuilder &, mlir::Location, mlir::ValueRange,
mlir::ValueRange, mlir::Value)> bodyBuilder) {
odsState.addOperands({lowerBound, upperBound, step});
auto bodyRegion = odsState.addRegion();
bodyRegion->push_back(new mlir::Block);
Expand Down