Function: memcpy2d_async

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Implements asynchronous memory copy, which is mainly used for matrix data replication. This is an asynchronous API.

The Atlas inference accelerator module does not support this API.

Prototype

Parameters

Parameter

Description

dst

Int, pointer address of the destination memory address.

dpitch

Int, address distance between two adjacent columns of vectors in the destination memory.

src

Int, pointer address of the source memory address.

spitch

Int, address distance between two adjacent columns of vectors in the source memory.

width

Int, matrix width to be copied.

It must be less than or equal to dpitch and spitch. The maximum value of width is 5000000.

height

Int, matrix height to be copied.

The maximum height can be set to 5242880 (5 x 1024 x 1024). Otherwise, a failure is returned.

kind

Int, memory copy type.

ACL_MEMCPY_HOST_TO_HOST = 0 // Copy memory within the host.
ACL_MEMCPY_HOST_TO_DEVICE = 1 // Copy memory from the host to the device.
ACL_MEMCPY_DEVICE_TO_HOST = 2 // Copy memory from the device to the host.
ACL_MEMCPY_DEVICE_TO_DEVICE = 3 // Copy memory within a device.
ACL_MEMCPY_DEFAULT = 4 // The system determines the copy direction based on the source and destination memory addresses.

stream

Int, pointer address of the stream.

Return Values

Return Value

Description

ret

Int, error code. 0 on success; else, failure.

Restrictions