OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HyperLogLogRank.h File Reference
+ Include dependency graph for HyperLogLogRank.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

FORCE_INLINE uint8_t get_rank (uint64_t x, uint32_t b)
 

Function Documentation

FORCE_INLINE uint8_t get_rank ( uint64_t  x,
uint32_t  b 
)

Definition at line 30 of file HyperLogLogRank.h.

Referenced by agg_approximate_count_distinct(), agg_approximate_count_distinct_gpu(), and approximate_distinct_tuples_impl().

30  {
31 #ifdef _MSC_VER
32  return std::min(b, static_cast<uint32_t>(x ? __lzcnt64(x) : 64)) + 1;
33 #else
34  return std::min(b, static_cast<uint32_t>(x ? __builtin_clzl(x) : 64)) + 1;
35 #endif
36 }

+ Here is the caller graph for this function: