文档
注册

ScalarGetSFFValue

功能说明

获取一个uint64_t类型数字的二进制中第一个0或1出现的位置,如果没找到则返回-1。

函数原型

template <int countValue> __aicore__ inline int64_t ScalarGetSFFValue(uint64_t valueIn);

参数说明

表1 参数说明

参数名

输入/输出

描述

valueIn

输入

输入数据,数据类型是uint64_t。

countValue

输入

获取到第一个0或1的位置。数据类型是int,值为0或1。

返回值

int64_t类型的数,valueIn中第一个0或1出现的位置。

支持的型号

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

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

约束说明

无。

调用示例

uint64_t valueIn = 28;
int64_t oneCount = ScalarGetSFFValue<1>(valueIn);
// 输出数据(oneCount): 2
搜索结果
找到“0”个结果

当前产品无相关内容

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