aclrtMemcpyAsync

Description

Implements asynchronous memory copy within the host, within a device, between devices, or between the host and device.

Restrictions

Prototype

aclError aclrtMemcpyAsync(void *dst, size_t destMax, const void *src, size_t count, aclrtMemcpyKind kind, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

dst

Input

Pointer to the destination memory address.

destMax

Input

Memory size in bytes in the destination address.

src

Input

Pointer to the source memory address.

count

Input

Size in bytes to copy.

kind

Input

Memory copy kind.

typedef enum aclrtMemcpyKind {
ACL_MEMCPY_HOST_TO_HOST, //Memory copy within the host
ACL_MEMCPY_HOST_TO_DEVICE, //Host to device memory copy
ACL_MEMCPY_DEVICE_TO_HOST, //Device to host memory copy
ACL_MEMCPY_DEVICE_TO_DEVICE     //Memory copy within a device or between devices
} aclrtMemcpyKind;

stream

Input

Stream.

Returns

0 on success; else, failure.

See Also

For the API call example, see Data Transfer.