ScalarGetSFFValue

Applicability

Product

Supported/Unsupported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

Atlas inference product's Vector Core

x

Atlas training products

x

Function Usage

Obtains the location where the first 0 or 1 starting from the least significant bit appears in the binary number of the uint64_t type. If the location is not found, –1 is returned.

Prototype

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

Parameters

Table 1 Parameters in the template

Parameter

Description

countValue

Specifies the value to be searched. The value 0 indicates that the position of the first 0 is searched, and the value 1 indicates that the position of the first 1 is searched. The data type is int. Only 0 or 1 can be entered.

Table 2 Parameters

Parameter

Input/Output

Description

valueIn

Input

Input data of the uint64_t type.

Returns

A number of the int64_t type, indicating the location where the first 0 or 1 appears in valueIn.

Constraints

None

Example

1
2
3
uint64_t valueIn = 28;
// Output (oneCount): 2
int64_t oneCount = AscendC::ScalarGetSFFValue<1>(valueIn);