Function: memcpy2d

Applicability

Product

Supported (√/x)

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

Function Usage

Implements synchronous memory copy, which is mainly used for matrix data replication.

The Atlas inference accelerator modules does not support these APIs.

Prototype

  • C Prototype
    1
    aclError aclrtMemcpy2d(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, aclrtMemcpyKind kind)
    
  • Python Function
    1
    ret = acl.rt.memcpy2d(dst, dpitch, src, spitch, width, height, kind)
    

Parameter Description

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.

height

Int, matrix height to be copied.

kind

Int, memory copy type.

Return Value Description

Return Value

Description

ret

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

Restrictions

  • Currently, only memory copy of the ACL_MEMCPY_HOST_TO_DEVICE and ACL_MEMCPY_DEVICE_TO_HOST types is supported.
  • For the Atlas 200I/500 A2 inference products: This API is not supported in Ascend RC form.