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

Function bit_ceil

include/util/math.h:68–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67template<class Integer>
68__host__ __device__ Integer bit_ceil(Integer x) {
69 static_assert(std::is_integral<Integer>::value, "bit_ceil() can only be invoked with integral types");
70 x--;
71#pragma unroll
72 for (int i = 1; i < sizeof(Integer) * 8; i *= 2)
73 x |= x >> i;
74 return x + 1;
75}
76
77} // namespace graphvie

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected