Copy

Applicable Products

Hardware Model

Supported or Not

Atlas 200I/500 A2 inference products

Not supported

Atlas inference products

Not supported

Atlas training products

Not supported

Atlas A2 training products/Atlas A2 inference products

Supported

Atlas A3 inference products/Atlas A3 training products

Supported

Function Description

API function

  • asdBlasMakeCopyPlan: initializes the Copy operator configuration corresponding to the handle.
  • asdBlasScopy: copies the values of a real-number vector to another vector.
  • asdBlasCcopy: copies the values of a complex-number vector to another vector.

Formula:

  • asdBlasScopy formula:
    • Example:

      Input x:

      [3, 4]

      After the Scopy operator is called, the output y is as follows:

      [3, 4]
  • asdBlasCcopy formula:
    • Example:

      Input x:

      [3+4i,4-3i,4+3i,3-4i]

      After the Ccopy operator is called, the output y is as follows:

      [3+4i,4-3i,4+3i,3-4i]

Function Prototype

  • AspbStatus asdBlasMakeCopyPlan(asdBlasHandle handle)
  • AspbStatus asdBlasScopy(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *y,const int64_t incy)
  • AspbStatus asdBlasCcopy(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *y,const int64_t incy)

Parameter Description

  • asdBlasMakeCopyPlan

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the Copy operator.

  • asdBlasScopy & asdBlasCcopy

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the Copy operator.

    n

    Input

    const int64_t

    Total number of elements.

    x

    Input

    aclTensor *

    x in the formula, which is a tensor on the device. The data format can be ND, and the shape is [n].

    • For Scopy, the supported data type is FLOAT32.
    • For Ccopy, the supported data type is COMPLEX64.

    incx

    Input

    const int64_t

    Memory address increment between consecutive elements of x (currently restricted to 1).

    y

    Output

    aclTensor *

    y in the formula, which is a tensor on the device. The data format can be ND, and the shape is [m, n]. The data format, data type, and shape are consistent with those of the input parameter x.

    • For Scopy, the supported data type is FLOAT32.
    • For Ccopy, the supported data type is COMPLEX64.

    incy

    Input

    const int64_t

    Memory address increment between consecutive elements of y (currently restricted to 1).

Return Value Description

For details about the return values, see Return Value.

Constraints

  • asdBlasMakeCopyPlan: none.
  • asdBlasScopy
    • The input element count n currently supports the range [1, 6.71e+06].
    • The input shape of the operator is [n], and the output shape is [n].
    • The operator does not support the calculation for three or more dimensions.
  • asdBlasCcopy
    • The input element count n currently supports the range [1, 6.71e+06].
    • The input shape of the operator is [n], and the output shape is [n].
    • The operator does not support the calculation for three or more dimensions.

Calling Example

For details about the operator calling example, see Copy.