ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::TaskflowExecutor Class Reference

the executor on an executor of Taskflow More...

#include <ADS/interop/parallel/TaskflowExecutor.h>

Public member functions

 TaskflowExecutor (tf::Executor &e)
 the executor on the executor of Taskflow \( e \), which it does not own and which must outlive it
std::size_t concurrency (void) const
 the number of the workers of Taskflow
template<class F>
void bulk (std::size_t n, F &&f)
 the calls \( f( 0 ) , \ldots , f( n - 1 ) \) by a graph of Taskflow, co-run from a worker of Taskflow

Detailed description

the executor on an executor of Taskflow

Constructor and destructor documentation

◆ TaskflowExecutor()

ADS::TaskflowExecutor::TaskflowExecutor ( tf::Executor & e)
inlineexplicit

the executor on the executor of Taskflow \( e \), which it does not own and which must outlive it

Member function documentation

◆ bulk()

template<class F>
void ADS::TaskflowExecutor::bulk ( std::size_t n,
F && f )
inline

the calls \( f( 0 ) , \ldots , f( n - 1 ) \) by a graph of Taskflow, co-run from a worker of Taskflow

In pseudocode (beyond the book):

\[\class{pseudocode}{\begin{array}{r@{\quad}l} 1 & \textbf{procedure}\ \mathrm{bulk}( n , f ) \cr 2 & \quad \textbf{if}\ n \le 1\ \textbf{or}\ p = 1\ \textbf{then} \ \textbf{for}\ i \gets 0\ \textbf{to}\ n - 1\ \textbf{do}\ f( i ) \cr 3 & \quad \mathit{tf} \gets \text{a graph of one } \mathrm{forEachIndex} \text{ on } [ 0 , n ) \text{, dynamic chunks of 1} \cr 4 & \quad \textbf{if}\ \text{the caller is a worker of Taskflow} \ \textbf{then}\ \mathrm{corun}( \mathit{tf} ) \ \textbf{else}\ \mathrm{run}( \mathit{tf} ).\mathrm{wait}() \cr 5 & \quad \text{throw again the first exception of the calls, if any} \end{array}} \]

◆ concurrency()

std::size_t ADS::TaskflowExecutor::concurrency ( void ) const
inlinenodiscard

the number of the workers of Taskflow


The documentation for this class was generated from the following file: