[Mlir-commits] [mlir] [mlir][OpenMP] inscan reduction modifier and scan op mlir support (PR #114737)
Sergio Afonso
llvmlistbot at llvm.org
Tue Jan 21 04:21:51 PST 2025
================
@@ -4591,6 +4591,10 @@ convertHostOrTargetOperation(Operation *op, llvm::IRBuilderBase &builder,
.Case([&](omp::AtomicCaptureOp op) {
return convertOmpAtomicCapture(op, builder, moduleTranslation);
})
+ .Case([&](omp::ScanOp) {
+ return op->emitError()
+ << "not yet implemented: " << op->getName() << " operation";
+ })
----------------
skatrak wrote:
I don't think this is necessary, since the default case already does this. With my previous comment I was referring to adding a case to `checkReduction` in `checkImplementationStatus` triggering a not-yet-implemented error if the `reduction_mod` is set to anything but "default". Something like this:
```c++
auto checkReduction = [&todo](auto op, LogicalResult &result) {
if (isa<omp::TeamsOp, omp::SimdOp>(op)) {
if (!op.getReductionVars().empty() || op.getReductionByref() ||
op.getReductionSyms())
result = todo("reduction");
}
if (op.getReductionMod() && op.getReductionMod().getValue() != omp::ReductionModifier::defaultmod)
result = todo("reduction with modifier");
};
```
You'd just need to also make sure that the updated `checkReduction` is called for all operations that can take `reduction` clauses: parallel, teams, sections, loop, wsloop, simd and taskloop.
https://github.com/llvm/llvm-project/pull/114737
More information about the Mlir-commits
mailing list