20 #ifndef GALOIS_RUNTIME_EXECUTOR_ONEACH_H
21 #define GALOIS_RUNTIME_EXECUTOR_ONEACH_H
23 #include "galois/config.h"
38 template <
typename FunctionTy,
typename ArgsTy>
39 inline void on_each_impl(FunctionTy&& fn,
const ArgsTy& argsTuple) {
41 static_assert(!has_trait<char*, ArgsTy>(),
"old loopname");
42 static_assert(!has_trait<char const*, ArgsTy>(),
"old loopname");
44 static constexpr
bool NEEDS_STATS = has_trait<loopname_tag, ArgsTy>();
45 static constexpr
bool MORE_STATS =
46 NEEDS_STATS && has_trait<more_stats_tag, ArgsTy>();
48 const char*
const loopname = galois::internal::getLoopName(argsTuple);
50 CondStatTimer<NEEDS_STATS> timer(loopname);
52 PerThreadTimer<MORE_STATS> execTime(loopname,
"Execute");
56 OperatorReferenceType<decltype(std::forward<FunctionTy>(fn))> fn_ref = fn;
73 template <
typename FunctionTy,
typename TupleTy>
74 inline void on_each_gen(FunctionTy&& fn,
const TupleTy& tpl) {
75 internal::on_each_impl(std::forward<FunctionTy>(fn), tpl);
ThreadPool & getThreadPool(void)
return a reference to system thread pool
Definition: ThreadPool.cpp:259
void run(unsigned num, Args &&...args)
execute work on all threads a simple wrapper for run
Definition: ThreadPool.h:142
unsigned int getActiveThreads() noexcept
Returns the number of threads in use.
Definition: Threads.cpp:37
const char * loopname
Definition: Executor_ParaMeter.h:145
void on_each_gen(FunctionTy &&fn, const TupleTy &tpl)
Definition: Executor_OnEach.h:74
static unsigned getTID()
Definition: ThreadPool.h:204