文档
注册
评分
提单
论坛
小AI

GetCmpMask

功能说明

此接口用于获取Compare(结果存入寄存器)指令的比较结果。

Compare(结果存入寄存器)指令会将比较后的结果写入CmpMask寄存器中,使用GetCmpMask接口可以获取到CmpMask寄存器的值从而得到Compare的结果。

函数原型

1
2
template<typename T>
__aicore__ inline void GetCmpMask(const LocalTensor<T>& dst)

参数说明

表1 参数说明

参数名

输入/输出

描述

dst

输出

Compare(结果存入寄存器)指令的比较结果。

类型为LocalTensor,支持的TPosition为VECIN/VECCALC/VECOUT。

返回值

支持的型号

Atlas推理系列产品(Ascend 310P处理器)AI Core

Atlas A2训练系列产品/Atlas 800I A2推理产品

约束说明

调用示例

Compare(结果存入寄存器)指令的结果使用uint8_t类型数据存储,因此dstLocal使用uint8_t类型。

1
2
3
4
5
6
7
AscendC::LocalTensor<float> src0Local;
AscendC::LocalTensor<float> src1Local;
AscendC::LocalTensor<uint8_t> dstLocal;
uint64_t mask = 256 / sizeof(float); // 256为每个迭代处理的字节数,结果为64
AscendC::BinaryRepeatParams repeatParams = { 1, 1, 1, 8, 8, 8 };
AscendC::Compare(src0Local, src1Local, AscendC::CMPMODE::LT, mask, repeatParams);
AscendC::GetCmpMask(dstLocal);
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词