Summary The omp_target_memcpy routine copies memory between any combination of host and device pointers.
int omp_target_memcpy(
void *dst,
const void *src,
size_t length,
size_t dst_offset,
size_t src_offset,
int dst_device_num,
int src_device_num
);
Constraints on ArgumentsEach device must be compatible with the device pointer specified on the same side of the copy. The dst_device_num and src_device_num must be greater than or equal to zero and less than the result of omp_get_num_devices() or equal to the result of a call to omp_get_initial_device().
Effectlength bytes of memory at offset src_offset from src in the device data environment of device src_device_num are copied to dst starting at offset dst_offset in the device data environment of device dst_device_num. The return value is zero on success and non-zero on failure. The host device and host device data environment can be referenced with the device number returned by omp_get_initial_device. This routine contains a task scheduling point. When called from within a target region the effect of this routine is unspecified.
Execution Model EventsThe target-data-op event occurs when a thread transfers data on a target device.
Tool CallbacksA thread invokes a registered ompt_callback_target_data_op callback for each occurrence of a target-data-op event in that thread. The callback occurs in the context of the target task and has type signature ompt_callback_target_data_op_t.