MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / findHighestSetBit

Function findHighestSetBit

src/include/clblas_stddef.h:83–94  ·  view source on GitHub ↗

* Return zero based sequential number of the highest set bit the * number. If the number is 0, then the function returns -1. */

Source from the content-addressed store, hash-verified

81 * number. If the number is 0, then the function returns -1.
82 */
83static __inline int
84findHighestSetBit(size_t a)
85{
86 int n = (sizeof(size_t) * 8 - 1);
87 size_t s = (size_t)1 << n;
88
89 for (; (s != 0) && !(s & a); s >>= 1) {
90 n--;
91 }
92
93 return (s == 0) ? -1 : n;
94}
95
96static __inline size_t
97roundDownPow2(size_t a)

Callers 6

sprintfFastScalarMadFunction · 0.85
sprintfLeadingDimensionFunction · 0.85
sprintfGboundKFunction · 0.85
genSetupItemPtrFunction · 0.85
genSetupPointersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected