MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Log2Floor

Function Log2Floor

tensorflow/core/lib/core/bits.h:39–39  ·  view source on GitHub ↗

Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.

Source from the content-addressed store, hash-verified

37
38// Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.
39inline int Log2Floor(uint32 n) { return n == 0 ? -1 : 31 ^ __builtin_clz(n); }
40
41// Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.
42inline int Log2Floor64(uint64 n) {

Callers 6

Log2Floor64Function · 0.70
Log2CeilingFunction · 0.70
HandleClzMethod · 0.50
HandleFftMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected