ScalarGetSFFValue
Applicability
Product |
Supported/Unsupported |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
x |
|
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
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. |
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); |