AbsSub(ISASI)
产品支持情况
功能说明
将src0Local与src1相减再求绝对值, 并将计算结果写入dst。计算公式如下:

函数原型
template <typename T>
__aicore__ inline void AbsSub(const LocalTensor<T> &dst, const LocalTensor<T> &src0, const LocalTensor<T> &src1, const uint32_t count)
参数说明
表 1 模板参数说明
表 2 参数说明
|
类型为LocalTensor,支持的TPosition为VECIN/VECCALC/VECOUT。 |
||
|
类型为LocalTensor,支持的TPosition为VECIN/VECCALC/VECOUT。 |
||
返回值说明
无
约束说明
- 操作数地址对齐要求请参见通用地址对齐约束。
调用示例
AscendC::AbsSub(dstLocal, src0Local, src1Local, 512);
结果示例如下:
输入数据src0Local:[1 2 3 ... 512]
输入数据src1Local:[513 514 515 ... 1024]
输出数据dstLocal:[512 512 512 ... 512]