Mull(ISASI)

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

x

Atlas A2 training product / Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Multiplies the first count data elements of src0 and src1 element-wise, and writes the result to dst0Local. If the result overflows, the overflow part is written to dst1Local. The formula is as follows:

Prototype

template <typename T>
__aicore__ inline void Mull(const LocalTensor<T>& dst0, const LocalTensor<T>& dst1, const LocalTensor<T>& src0, const LocalTensor<T>& src1, const uint32_t count)

Parameters

Table 1 Template parameters

Parameter

Description

T

Operand data type.

For the Atlas 350 Accelerator Card, the supported data types are int32_t and uint32_t.

Table 2 Parameters

Parameter

Input/Output

Description

dst0 and dst1

Output

Destination operand.

The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT.

The start address of LocalTensor must be 32-byte aligned.

src0 and src1

Input

Source operand.

The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT.

The start address of LocalTensor must be 32-byte aligned.

Both source operands must have the same data type as the destination operand.

count

Input

Number of elements involved in the computation.

Returns

None

Restrictions

Examples

For more examples, see LINK.

1
AscendC::Mull(dst0Local, dst1Local, src0Local, src1Local, 512);
Result example:
Input (src0Local): [-2039520159    95829766 -1522913829 ... ]
Input (src1Local): [-1791575569  -291976917 -1973597151 ... ]
Output (dst0Local): [-1560359025   212356098  1219226939 ... ]
Output (dst1Local): [850752575   -6514620  699800065 ... ]