23 #ifndef BUFFER_COMPACTION_H
24 #define BUFFER_COMPACTION_H
27 #include "../Shared/funcannotations.h"
37 return std::max(qw, low_bound);
43 addr +=
sizeof(int64_t) - 1;
44 return (
T)(((uint64_t)addr >> 3) << 3);
49 template <
size_t N,
typename T>
51 constexpr
T mask =
static_cast<T>(
N - 1);
52 static_assert(
N && (
N & mask) == 0,
"N must be a power of 2.");
53 return (val + mask) & ~mask;
unsigned compact_byte_width(unsigned qw, unsigned low_bound)
FORCE_INLINE HOST DEVICE T align_to(T const val)
constexpr int8_t MAX_BYTE_WIDTH_SUPPORTED
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)