Target Data
From what we've seen so far, each target region has its own set of variables to map on entry. For programs with multiple target regions that map the same variables, data will be transferred to and from the device repeatedly, and depending on the sizes of the variables, this could lead to significant performance overhead. To avoid this, the target data directive creates a persistent data region on the device that transfers the data once on entry and once on exit, and target regions inside the target data block can reuse the mapped data without redundant transfers.
The target data directive accepts the same map clause as the target directive, with the same map-types (to, from, tofrom, alloc) and modifiers (always). It also accepts the device and if clauses, similar to the target directive.
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)