29 std::enable_if_t<is_static_task_v<C>,
Task>
emplace(C&& callable);
41 std::enable_if_t<is_dynamic_task_v<C>,
Task>
emplace(C&& callable);
53 std::enable_if_t<is_condition_task_v<C>,
Task>
emplace(C&& callable);
66 std::enable_if_t<is_cudaflow_task_v<C>,
Task>
emplace(C&& callable);
78 template <
typename... C, std::enable_if_t<(
sizeof...(C)>1),
void>* =
nullptr>
181 template <
typename B,
typename E,
typename C>
205 template <
typename B,
typename E,
typename C,
typename H =
size_t>
229 template <
typename B,
typename E,
typename C,
typename H =
size_t>
253 template <
typename B,
typename E,
typename C,
typename H =
size_t>
255 B&& beg, E&& end, C&& callable, H&& chunk_size = 0
294 template <
typename B,
typename E,
typename S,
typename C>
320 template <
typename B,
typename E,
typename S,
typename C,
typename H =
size_t>
322 B&& beg, E&& end, S&& step, C&& callable, H&& chunk_size = 1
348 template <
typename B,
typename E,
typename S,
typename C,
typename H =
size_t>
350 B&& beg, E&& end, S&& step, C&& callable, H&& chunk_size = 1
376 template <
typename B,
typename E,
typename S,
typename C,
typename H =
size_t>
378 B&& beg, E&& end, S&& step, C&& callable, H&& chunk_size = 0
412 template <
typename B,
typename E,
typename T,
typename O>
413 Task reduce(B&& first, E&& last, T& init, O&& bop);
436 template <
typename B,
typename E,
typename T,
typename O,
typename H =
size_t>
438 B&& first, E&& last, T& init, O&& bop, H&& chunk_size = 1
462 template <
typename B,
typename E,
typename T,
typename O,
typename H =
size_t>
464 B&& first, E&& last, T& init, O&& bop, H&& chunk_size = 1
488 template <
typename B,
typename E,
typename T,
typename O,
typename H =
size_t>
490 B&& first, E&& last, T& init, O&& bop, H&& chunk_size = 0
526 template <
typename B,
typename E,
typename T,
typename BOP,
typename UOP>
552 template <
typename B,
typename E,
typename T,
typename BOP,
typename UOP,
typename H =
size_t>
554 B&& first, E&& last, T& init, BOP&& bop, UOP&& uop, H&& chunk_size = 1
580 template <
typename B,
typename E,
typename T,
typename BOP,
typename UOP,
typename H =
size_t>
582 B&& first, E&& last, T& init, BOP&& bop, UOP&& uop, H&& chunk_size = 0
608 template <
typename B,
typename E,
typename T,
typename BOP,
typename UOP,
typename H =
size_t>
610 B&& first, E&& last, T& init, BOP&& bop, UOP&& uop, H&& chunk_size = 1
628 template <
typename L>
638 template <
typename... C, std::enable_if_t<(
sizeof...(C)>1),
void>*>
640 return std::make_tuple(
emplace(std::forward<C>(cs))...);
645 template <
typename C>
647 auto n =
_graph.emplace_back(
648 nstd::in_place_type_t<Node::StaticWork>{}, std::forward<C>(c)
655 template <
typename C>
657 auto n =
_graph.emplace_back(
658 nstd::in_place_type_t<Node::DynamicWork>{}, std::forward<C>(c)
665 template <
typename C>
667 auto n =
_graph.emplace_back(
668 nstd::in_place_type_t<Node::ConditionWork>{}, std::forward<C>(c)
673 #ifdef TF_ENABLE_CUDA 676 template <
typename C>
678 auto n =
_graph.emplace_back(
679 nstd::in_place_type_t<Node::cudaFlowWork>{}, std::forward<C>(c)
687 auto node =
_graph.emplace_back(
688 nstd::in_place_type_t<Node::ModuleWork>{}, &taskflow
695 from._node->_precede(to._node);
714 for(
auto from : froms) {
721 for(
auto from : froms) {
728 auto node =
_graph.emplace_back();
918 template <
typename L>
919 void FlowBuilder::_linearize(L& keys) {
921 auto itr = keys.begin();
922 auto end = keys.end();
930 for(++nxt; nxt != end; ++nxt, ++itr) {
931 itr->_node->_precede(nxt->_node);
993 bool _joinable {
true};
997 inline Subflow::Subflow(
Executor& executor, Node* parent, Graph& graph) :
999 _executor {executor},
void linearize(std::vector< Task > &tasks)
adds adjacent dependency links to a linear list of tasks
Definition: flow_builder.hpp:936
bool joinable() const
queries if the subflow is joinable
Definition: flow_builder.hpp:1004
Task for_each_index_guided(B &&beg, E &&end, S &&step, C &&callable, H &&chunk_size=1)
constructs an index-based parallel-for task using the guided partition algorithm. ...
Task transform_reduce_guided(B &&first, E &&last, T &init, BOP &&bop, UOP &&uop, H &&chunk_size=1)
constructs a STL-styled parallel transform-reduce task using the guided partition algorithm ...
Task transform_reduce_static(B &&first, E &&last, T &init, BOP &&bop, UOP &&uop, H &&chunk_size=0)
constructs a STL-styled parallel transform-reduce task using the static partition algorithm ...
void broadcast(Task A, std::vector< Task > &others)
adds dependency links from one task A to many tasks
Definition: flow_builder.hpp:699
Task for_each_guided(B &&beg, E &&end, C &&callable, H &&chunk_size=1)
constructs a STL-styled parallel-for task using the guided partition algorithm
Task transform_reduce_dynamic(B &&first, E &&last, T &init, BOP &&bop, UOP &&uop, H &&chunk_size=1)
constructs a STL-styled parallel transform-reduce task using the dynamic partition algorithm ...
Task for_each_static(B &&beg, E &&end, C &&callable, H &&chunk_size=0)
constructs a STL-styled parallel-for task using the dynamic partition algorithm
Graph & _graph
associated graph object
Definition: flow_builder.hpp:624
void succeed(std::vector< Task > &others, Task A)
adds dependency links from many tasks to one task A
Definition: flow_builder.hpp:713
Task placeholder()
creates an empty task
Definition: flow_builder.hpp:727
void detach()
enables the subflow to detach from its parent task
Definition: executor.hpp:1276
Task reduce_dynamic(B &&first, E &&last, T &init, O &&bop, H &&chunk_size=1)
constructs a STL-styled parallel-reduce task using the dynamic partition algorithm ...
Task reduce_static(B &&first, E &&last, T &init, O &&bop, H &&chunk_size=0)
constructs a STL-styled parallel-reduce task using the static partition algorithm ...
Task for_each_index_static(B &&beg, E &&end, S &&step, C &&callable, H &&chunk_size=0)
constructs an index-based parallel-for task using the static partition algorithm. ...
Task for_each_index(B &&first, E &&last, S &&step, C &&callable)
constructs an index-based parallel-for task
Task & succeed(Ts &&... tasks)
adds precedence links from other tasks to this
Definition: task.hpp:362
std::enable_if_t< is_static_task_v< C >, Task > emplace(C &&callable)
creates a static task from a given callable object
Definition: flow_builder.hpp:646
Task composed_of(Taskflow &taskflow)
creates a module task from a taskflow
Definition: flow_builder.hpp:686
Task reduce(B &&first, E &&last, T &init, O &&bop)
constructs a STL-styled parallel-reduce task
void precede(Task A, Task B)
adds a dependency link from task A to task B
Definition: flow_builder.hpp:694
main entry to create a task dependency graph
Definition: core/taskflow.hpp:18
Task for_each_dynamic(B &&beg, E &&end, C &&callable, H &&chunk_size=1)
constructs a STL-styled parallel-for task using the dynamic partition algorithm
FlowBuilder(Graph &graph)
constructs a flow builder with a graph
Definition: flow_builder.hpp:633
Task for_each(B &&first, E &&last, C &&callable)
constructs a STL-styled parallel-for task
building methods of a task dependency graph
Definition: flow_builder.hpp:13
handle to a node in a task dependency graph
Definition: task.hpp:113
Task for_each_index_dynamic(B &&beg, E &&end, S &&step, C &&callable, H &&chunk_size=1)
constructs an index-based parallel-for task using the dynamic partition algorithm.
Task transform_reduce(B &&first, E &&last, T &init, BOP &&bop, UOP &&uop)
constructs a STL-styled parallel transform-reduce task
Task & precede(Ts &&... tasks)
adds precedence links from this to other tasks
Definition: task.hpp:339
execution interface for running a taskflow graph
Definition: executor.hpp:24
building methods of a subflow graph in dynamic tasking
Definition: flow_builder.hpp:956
void join()
enables the subflow to join its parent task
Definition: executor.hpp:1266
Task reduce_guided(B &&first, E &&last, T &init, O &&bop, H &&chunk_size=1)
constructs a STL-styled parallel-reduce task using the guided partition algorithm ...