| 41 | // Test if a pointer is aligned to N bytes |
| 42 | template <int N> |
| 43 | CUTE_HOST_DEVICE constexpr |
| 44 | bool |
| 45 | is_byte_aligned(void const* const ptr) |
| 46 | { |
| 47 | static_assert(has_single_bit(N), "N must be a power of 2 in alignment check"); |
| 48 | return (reinterpret_cast<uintptr_t>(ptr) & (N-1)) == 0; |
| 49 | } |
| 50 | |
| 51 | #if defined(__CUDACC__) |
| 52 | # define CUTE_ALIGNAS(n) __align__(n) |
nothing calls this directly
no test coverage detected