ScalarGetSFFValue
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
x |
|
x |
Function
Obtains the position of the first 0 or 1 starting from the least significant bit in the binary representation of a uint64_t value. Returns –1 if no such position is found.
Prototype
1 2 | template <int countValue> __aicore__ inline int64_t ScalarGetSFFValue(uint64_t valueIn) |
Parameters
Parameter |
Description |
|---|---|
countValue |
Value to be searched for. It is of int type and must be 0 or 1. 0 indicates that the position of the first 0 is to be searched for, and 1 indicates that the position of the first 1 is to be searched for. |
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.
Restrictions
None
Example
1 2 3 | uint64_t valueIn = 28; // Output (oneCount): 2 int64_t oneCount = AscendC::ScalarGetSFFValue<1>(valueIn); |