#ifndef UTILITY_HPP #define UTILITY_HPP #include #include #include template size_t alignment_round(size_t size, const size_t align = Align) { assert(std::popcount(align) == 1); if (size & (align - 1)) { size = (size + align) & ~(align - 1); } return size; } extern BS::thread_pool *g_thread_pool; template void thread_pool_detach_task(Func &&func) { g_thread_pool->detach_task(std::forward(func)); } #define TP_DETACH(func) thread_pool_detach_task(func) #define TP_SYNC g_thread_pool->wait() #endif //UTILITY_HPP