#pragma once #include #include "../core/async.hpp" namespace tf { // Function: launch_loop template TF_FORCE_INLINE void launch_loop(P part, Loop loop) { constexpr bool is_default_wrapper_v = std::is_same_v< typename std::decay_t

::closure_wrapper_type, DefaultClosureWrapper >; if constexpr(is_default_wrapper_v) { loop(); } else { std::invoke(part.closure_wrapper(), loop); } } // Function: launch_loop template TF_FORCE_INLINE void launch_loop( size_t N, size_t W, Runtime& rt, std::atomic& next, P part, Loop loop ) { //static_assert(std::is_lvalue_reference_v, ""); using namespace std::string_literals; for(size_t w=0; w TF_FORCE_INLINE void launch_loop( size_t W, size_t w, Runtime& rt, P part, Loop loop ) { using namespace std::string_literals; if(w == W-1) { launch_loop(part, loop); } else { rt.silent_async_unchecked([=](){ launch_loop(part, loop); }); } } } // end of namespace tf -----------------------------------------------------