Skip to content

Commit c5036b9

Browse files
authored
[triton][NFC] Refactor build function of ScanOp (triton-lang#5861)
It's better to use ScanOp's build function to replace ReduceOp's. <!--- The core Triton is a small number of people, and we receive many PRs (thank you!). To help us review your code more quickly, **if you are a new contributor (less than 3 PRs merged) we ask that you complete the following tasks and include the filled-out checklist in your PR description.** Complete the following tasks before sending your PR, and replace `[ ]` with `[x]` to indicate you have done them. --> # New contributor declaration - [x] I am not making a trivial change, such as fixing a typo in a comment. - [x] I have written a PR description following these [rules](https://cbea.ms/git-commit/#why-not-how). - [x] I have run `pre-commit run --from-ref origin/main --to-ref HEAD`. - Select one of the following. - [ ] I have added tests. - `/test` for `lit` tests - `/unittest` for C++ tests - `/python/test` for end-to-end tests - [x] This PR does not need a test because `FILL THIS IN`. - Select one of the following. - [x] I have not added any `lit` tests. - [ ] The `lit` tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices), including the "tests should be minimal" section. (Usually running Python code and using the instructions it generates is not minimal.)
1 parent eef7e22 commit c5036b9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Dialect/Triton/IR/Ops.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,9 @@ unsigned ReduceOp::getNumOperands() { return this->getOperands().size(); }
551551
void ScanOp::build(OpBuilder &builder, OperationState &state,
552552
ValueRange operands, int axis, bool reverse) {
553553
SmallVector<Type> inferredReturnTypes;
554-
state.addAttribute("reverse", builder.getBoolAttr(reverse));
555554
for (auto arg : operands)
556555
inferredReturnTypes.push_back(arg.getType());
557-
ReduceOp::build(builder, state, inferredReturnTypes, operands, axis);
556+
ScanOp::build(builder, state, inferredReturnTypes, operands, axis, reverse);
558557
}
559558

560559
LogicalResult

0 commit comments

Comments
 (0)