20#include <dispenso/detail/math.h>
21#include <dispenso/detail/op_result.h>
46inline void* alignedMalloc(
size_t bytes,
size_t alignment) {
47 return detail::alignedMalloc(bytes, alignment);
62inline void* alignedMalloc(
size_t bytes) {
63 return detail::alignedMalloc(bytes);
73inline void alignedFree(
void* ptr) {
74 detail::alignedFree(ptr);
111inline constexpr uintptr_t alignToCacheLine(uintptr_t val) {
112 return detail::alignToCacheLine(val);
131inline void cpuRelax() {
152 return detail::nextPow2(v);
173 return detail::log2const(v);
193inline uint32_t
log2(uint64_t v) {
194 return detail::log2(v);
255using OpResult = detail::OpResult<T>;
285 return detail::staticChunkSize(items, chunks);
detail::OpResult< T > OpResult
Optional-like storage with in-place construction (C++14 compatible).
detail::AlignedAtomic< T > AlignedAtomic
Cache-line aligned atomic pointer.
detail::AlignedFreeDeleter< T > AlignedDeleter
Deleter for smart pointers that use aligned memory allocation.
detail::AlignedBuffer< T > AlignedBuffer
Buffer with proper alignment for type T.
detail::StaticChunking StaticChunking
Information for statically chunking a range across threads.
constexpr uint32_t log2const(uint64_t v)
Compute log base 2 of a value (compile-time).
uint32_t log2(uint64_t v)
Compute log base 2 of a value (runtime).
constexpr uint64_t nextPow2(uint64_t v)
Round up to the next power of 2.