|
ADS
Algorithms and Data Structures
|
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 | |
the executor on an executor of Taskflow
|
inlineexplicit |
the executor on the executor of Taskflow \( e \), which it does not own and which must outlive it
|
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}} \]
|
inlinenodiscard |
the number of the workers of Taskflow