| 125 | // Checks if a number is an integral power of two |
| 126 | template <class T> |
| 127 | CUTE_HOST_DEVICE constexpr |
| 128 | bool |
| 129 | has_single_bit(T x) { |
| 130 | return x != 0 && (x & (x - 1)) == 0; |
| 131 | } |
| 132 | |
| 133 | // Smallest number of bits needed to represent the given value |
| 134 | // For x == 0, this is 0 |
no outgoing calls
no test coverage detected