omp_target_memcpy

Purpose

The omp_target_memcpy function copies memory between pointers, which can be either host or target device pointers.

Prototype

int omp_target_memcpy(void * dst, void * src,
     size_t length, size_t dst_offset, size_t src_offset,
     int dst_device_num, int src_device_num);

Parameters

dst
Specifies the address in the memory of the destination device.
src
Specifies the address in the memory of the source device.
length
Specifies the number of bytes of memory to be copied.
dst_offset
Specifies the offset to be applied to dst.
src_offset
Specifies the offset to be applied to src.
dst_device_num
Must be the device number of the host device or be non-negative and less than the number of target devices. It represents the destination device of the copy.
src_device_num
Must be the device number of the host device or be non-negative and less than the number of target devices. It represents the source device of the copy.

Usage

The length 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.

It returns zero on success and nonzero on failure.

GPU begins You cannot call this function on a target device. GPU ends



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us