[Mlir-commits] [mlir] [Flang] [MLIR] [OpenMP] Add initial MLIR op support for OMP TARGET UPDATE directive (PR #74699)
Kareem Ergawy
llvmlistbot at llvm.org
Wed Dec 6 23:20:03 PST 2023
================
@@ -1416,6 +1416,50 @@ def TargetOp : OpenMP_Op<"target",[IsolatedFromAbove, OutlineableOpenMPOpInterfa
let hasVerifier = 1;
}
+//===---------------------------------------------------------------------===//
+// 2.14.6 target update data Construct
+//===---------------------------------------------------------------------===//
+
+def Target_UpdateDataOp: OpenMP_Op<"target_update_data",
+ [AttrSizedOperandSegments]>{
+ let summary = "target update data construct";
+ let description = [{
+ The target update directive makes the corresponding list items in the device
+ data environment consistent with their original list items, according to the
+ specified motion clauses. The target update construct is a stand-alone
+ directive.
+
+ The optional $if_expr parameter specifies a boolean result of a
+ conditional check. If this value is 1 or is not provided then the target
+ region runs on a device, if it is 0 then the target region is executed
+ on the host device.
+
+ The optional $device parameter specifies the device number for the
+ target region.
+
+ The optional $nowait eliminates the implicit barrier so the parent
+ task can make progress even if the target task is not yet completed.
+
+ TODO: depend, to and from clauses
+ }];
+
+ let arguments = (ins Optional<I1>:$if_expr,
+ Optional<AnyInteger>:$device,
+ UnitAttr:$nowait,
+ Variadic<OpenMP_PointerLikeType>:$to_operands,
+ Variadic<OpenMP_PointerLikeType>:$from_operands);
----------------
ergawy wrote:
Since `to` & `from` clauses are not fully supported yet (as I can see from your TODO and from the TODO in `UpdateDataOp::verify` below, maybe we should remove them as well from the assembly format and argument list for now? I think either fully leaving out their support or fully supporting them in this PR would be cleaner. Halfway through might not be the best option.
Or maybe you are planning to add another commit to fully support them in this PR?
https://github.com/llvm/llvm-project/pull/74699
More information about the Mlir-commits
mailing list