Template Function sequant::parallel_do¶
Defined in File runtime.hpp
Function Documentation¶
-
template<typename Lambda>
void sequant::parallel_do(Lambda &&lambda)¶ Fires off
nthreads
instances of lambda in parallel, each in its own thread (thusnthreads-1
std::thread objects are created), wherenthreads
is the value returned by get_num_threads() .See also
get_num_threads()
- Template Parameters:
Lambda – a function type for which
Lambda(int)
is valid- Parameters:
lambda – the function object to execute, each will be invoked as
lambda(thread_id)
wherethread_id
is an integer in[0,nthreads) .