MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / bit_floor

Function bit_floor

include/util/math.h:59–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57
58template<class Integer>
59__host__ __device__ Integer bit_floor(Integer x) {
60 static_assert(std::is_integral<Integer>::value, "bit_floor() can only be invoked with integral types");
61#pragma unroll
62 for (int i = 1; i < sizeof(Integer) * 8; i *= 2)
63 x |= x >> i;
64 return (x + 1) >> 1;
65}
66
67template<class Integer>
68__host__ __device__ Integer bit_ceil(Integer x) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected