Target Update
The target update directive synchronizes data between host and device without allocating or deallocating any memory. The data must already be present on the device from a target data or target enter data. Unlike enter/exit data, target update does not change the reference counting of variables. This directive is useful when the host modifies data between two regions and needs to update values to the device, or when the host needs to update its values from the device after completing a computation.
The syntax is target update to(vars) to copy from host to device, and target update from(vars) to copy from device to host. Note that the syntax uses to() and from() directly, not map(to:) or map(from:).
Note that an array that has previously been allocated on the device with map(alloc) can easily be initialized from the host side by using target update to(array). The same thing can be accomplished with target enter data map(always, to: array), but be aware that the latter increases the reference count of array, since the always modifier forces a copy regardless of whether array is already allocated on the device.
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)