We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87ec30c commit fcd5871Copy full SHA for fcd5871
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -1543,6 +1543,15 @@ Operation *TargetOp::getInnermostCapturedOmpOp() {
1543
1544
bool TargetOp::isTargetSPMDLoop() {
1545
Operation *capturedOp = getInnermostCapturedOmpOp();
1546
+
1547
+ // Allow an omp.atomic_update to be captured inside of the loop and still
1548
+ // consider the parent omp.target operation to be potentially defining an SPMD
1549
+ // loop.
1550
+ // TODO: Potentially accept other captured OpenMP dialect operations as well,
1551
+ // if they are allowed inside of an SPMD loop.
1552
+ if (isa_and_present<AtomicUpdateOp>(capturedOp))
1553
+ capturedOp = capturedOp->getParentOp();
1554
1555
if (!isa_and_present<LoopNestOp>(capturedOp))
1556
return false;
1557
0 commit comments