ScalarGetCountOfValue
Applicability
Product |
Supported/Unsupported |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
x |
|
x |
Function Usage
Obtains the number of 0s or 1s in a binary number of the uint64_t type.
Prototype
1 2 | template <int countValue> __aicore__ inline int64_t ScalarGetCountOfValue(uint64_t valueIn) |
Parameters
Parameter |
Description |
|---|---|
countValue |
0 or 1 to be counted. Enter 0 or 1. |
Parameter |
Input/Output |
Description |
|---|---|---|
valueIn |
Input |
A binary number. |
Returns
Number of 0s or 1s in valueIn.
Constraints
None
Example
1 2 3 | uint64_t valueIn = 0xffff; // Output (oneCount): 16 int64_t oneCount = AscendC::ScalarGetCountOfValue<1>(valueIn); |
Parent topic: Scalar Computation