3.7.6 omp_target_memcpy_async – Copy data between devices asynchronously

Description:

This routine copies asynchronously length of bytes of data from the device identified by device number src_device_num to device dst_device_num. The data is copied from the source device from the address provided by src, shifted by the offset of src_offset bytes, to the destination device’s dst address shifted by dst_offset. Task dependence is expressed by passing an array of depend objects to depobj_list, where the number of array elements is passed as depobj_count; if the count is zero, the depobj_list argument is ignored. The routine returns zero if the copying process has successfully been started and non-zero otherwise.

Running this routine in a target region except on the initial device is not supported.

C/C++
Prototype:int omp_target_memcpy_async(void *dst,
const void *src,
size_t length,
size_t dst_offset,
size_t src_offset,
int dst_device_num,
int src_device_num,
int depobj_count,
omp_depend_t *depobj_list)
Fortran:
Interface:integer(c_int) function omp_target_memcpy_async( &
dst, src, length, dst_offset, src_offset, &
dst_device_num, src_device_num, &
depobj_count, depobj_list) bind(C)
use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
type(c_ptr), value :: dst, src
integer(c_size_t), value :: length, dst_offset, src_offset
integer(c_int), value :: dst_device_num, src_device_num, depobj_count
integer(omp_depend_kind), optional :: depobj_list(*)
See also:

omp_target_memcpy – Copy data between devices, omp_target_memcpy_rect_async – Copy a subvolume of data between devices asynchronously

Reference:

OpenMP specification v5.1, Section 3.8.7