Function: memcpy2d

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

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

The Atlas inference accelerator module does not support this API.

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)
    

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.

height

Int, matrix height to be copied.

kind

Int, memory copy type.

Return Value

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 product and Ascend RC form, this API is not supported.