ExpSub(ISASI)
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Subtracts src1 from src0, uses the difference as the exponent to compute the power of the natural constant e, and stores the result to dst.
If the source operands are of float type, the formula is as follows:

If the source operands are of half type, the formula is as follows:
For the Atlas 350 Accelerator Card:

Prototype
1 2 | template <typename T, typename U> __aicore__ inline void ExpSub(const LocalTensor<T>& dst, const LocalTensor<U>& src0, const LocalTensor<U>& src1, const uint32_t count) |
Parameters
Parameter |
Description |
|---|---|
T |
Data type of the destination operand. For the Atlas 350 Accelerator Card, the supported data types are half and float. |
U |
Data type of the source operands. For the Atlas 350 Accelerator Card, the supported data types are half and float. |
Parameter |
Input/Output |
Description |
|---|---|---|
dst |
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/src1 |
Input |
Source operands. The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT. The start address of LocalTensor must be 32-byte aligned. |
count |
Input |
Number of elements involved in the computation. |
Returns
None
Restrictions
- For details about the operand address alignment requirements, see General Address Alignment Restrictions.
Examples
1 | AscendC::ExpSub(dstLocal, src0Local, src1Local, 512); |
Input (src0Local): [1 2 4 ... 510] Input (src1Local): [1 1 2 ... 510] Output (dstLocal): [1 2.71828 7.38905 ... 1]