MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / is_byte_aligned

Function is_byte_aligned

include/cute/container/alignment.hpp:43–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41// Test if a pointer is aligned to N bytes
42template <int N>
43CUTE_HOST_DEVICE constexpr
44bool
45is_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)

Callers

nothing calls this directly

Calls 1

has_single_bitFunction · 0.85

Tested by

no test coverage detected