| 66 | |
| 67 | template<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 |
nothing calls this directly
no outgoing calls
no test coverage detected