dataClauseOperands, mlir::acc::DataClause::acc_update_device, false);
} else if (std::get_if<Fortran::parser::AccClause::IfPresent>(&clause.u)) {
addIfPresentAttr = true;
+ } else if (const auto *selfClause =
+ std::get_if<Fortran::parser::AccClause::Self>(&clause.u)) {
+ const std::optional<Fortran::parser::AccSelfClause> &accSelfClause =
+ selfClause->v;
+ const auto *accObjectList =
+ std::get_if<Fortran::parser::AccObjectList>(&(*accSelfClause).u);
+ assert(accObjectList && "expect AccObjectList");
+ genDataOperandOperations<mlir::acc::GetDevicePtrOp>(
+ *accObjectList, converter, semanticsContext, stmtCtx,
+ updateHostOperands, mlir::acc::DataClause::acc_update_self, false);
}
}
! CHECK: acc.update dataOperands(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>) attributes {ifPresent}{{$}}
! CHECK: acc.update_host accPtr(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) {name = "a", structured = false}
+ !$acc update self(a)
+! CHECK: %[[DEVPTR_A:.*]] = acc.getdeviceptr varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = 18 : i64, name = "a", structured = false}
+! CHECK: acc.update dataOperands(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>){{$}}
+! CHECK: acc.update_host accPtr(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) {dataClause = 18 : i64, name = "a", structured = false}
+
!$acc update host(a) if(.true.)
! CHECK: %[[DEVPTR_A:.*]] = acc.getdeviceptr varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = 17 : i64, name = "a", structured = false}
! CHECK: %[[IF1:.*]] = arith.constant true
getDataClause() != acc::DataClause::acc_copyout &&
getDataClause() != acc::DataClause::acc_delete &&
getDataClause() != acc::DataClause::acc_detach &&
- getDataClause() != acc::DataClause::acc_update_host)
+ getDataClause() != acc::DataClause::acc_update_host &&
+ getDataClause() != acc::DataClause::acc_update_self)
return emitError("getDevicePtr mismatch");
return success();
}