109 template <
typename C,
145 template <
typename C,
174 template <
typename... C,
std::enable_if_t<(
sizeof...(C)>1),
void>* =
nullptr>
175 auto emplace(C&&... callables);
250 template <
typename T>
305 template <
typename C,
332 template <
typename C,
typename D,
360 template <
typename C, std::enable_if_t<is_syclflow_task_v<C>,
void>* =
nullptr>
388 template <
typename C,
typename Q,
414 template <
typename C,
488 template <
typename B,
typename E,
typename C>
527 template <
typename B,
typename E,
typename S,
typename C>
563 template <
typename B,
typename E,
typename O,
typename C>
597 template <
typename B1,
typename E1,
typename B2,
typename O,
typename C>
634 template <
typename B,
typename E,
typename T,
typename O>
673 template <
typename B,
typename E,
typename T,
typename BOP,
typename UOP>
698 template <
typename B,
typename E,
typename C>
719 template <
typename B,
typename E>
731 template <
typename L>
741template <
typename C, std::enable_if_t<is_static_task_v<C>,
void>*>
749template <
typename C, std::enable_if_t<is_dynamic_task_v<C>,
void>*>
757template <
typename C, std::enable_if_t<is_condition_task_v<C>,
void>*>
759 return Task(
_graph._emplace_back(
765template <
typename C, std::enable_if_t<is_multi_condition_task_v<C>,
void>*>
767 return Task(
_graph._emplace_back(
773template <
typename C, std::enable_if_t<is_runtime_task_v<C>,
void>*>
775 return Task(
_graph._emplace_back(
794 auto& S = dependent._node->_successors;
795 if(
auto I =
std::find(S.begin(), S.end(), task._node); I != S.end()) {
801 auto& D = dependent._node->_dependents;
802 if(
auto I =
std::find(D.begin(), D.end(), task._node); I != D.end()) {
807 _graph._erase(task._node);
813 auto node =
_graph._emplace_back(
821 auto node =
_graph._emplace_back();
827void FlowBuilder::_linearize(L& keys) {
829 auto itr = keys.begin();
830 auto end = keys.end();
838 for(++nxt; nxt != end; ++nxt, ++itr) {
839 itr->_node->_precede(nxt->_node);
993 template <
typename F,
typename... ArgsT>
994 auto async(F&& f, ArgsT&&... args);
1034 template <
typename F,
typename... ArgsT>
1055 template <
typename F,
typename... ArgsT>
1076 template <
typename F,
typename... ArgsT>
1089 bool _joinable {
true};
1093 template <
typename F,
typename... ArgsT>
1094 auto _named_async(Worker& w,
const std::string& name, F&& f, ArgsT&&... args);
1096 template <
typename F,
typename... ArgsT>
1097 void _named_silent_async(Worker& w,
const std::string& name, F&& f, ArgsT&&... args);
1101inline Subflow::Subflow(
1102 Executor& executor, Worker& worker, Node* parent,
Graph& graph
1105 _executor {executor},
class to create an executor for running a taskflow graph
Definition executor.hpp:50
class to build a task dependency graph
Definition flow_builder.hpp:21
Task transform_reduce(B first, E last, T &init, BOP bop, UOP uop)
constructs a STL-styled parallel transform-reduce task
Task sort(B first, E last, C cmp)
constructs a dynamic task to perform STL-styled parallel sort
Task for_each_index(B first, E last, S step, C callable)
constructs a parallel-transform task
void erase(Task task)
removes a task from a taskflow
Definition flow_builder.hpp:787
Task emplace(C &&callable)
creates a static task
Definition flow_builder.hpp:742
FlowBuilder(Graph &graph)
constructs a flow builder with a graph
Definition flow_builder.hpp:736
Task sort(B first, E last)
constructs a dynamic task to perform STL-styled parallel sort using the std::less<T> comparator,...
void linearize(std::vector< Task > &tasks)
adds adjacent dependency links to a linear list of tasks
Definition flow_builder.hpp:844
Graph & _graph
associated graph object
Definition flow_builder.hpp:727
Task transform(B1 first1, E1 last1, B2 first2, O d_first, C c)
constructs a parallel-transform task
Task reduce(B first, E last, T &init, O bop)
constructs a STL-styled parallel-reduce task
Task for_each(B first, E last, C callable)
constructs a STL-styled parallel-for task
Task transform(B first1, E last1, O d_first, C c)
constructs a parallel-transform task
Task composed_of(T &object)
creates a module task for the target object
Definition flow_builder.hpp:812
Task placeholder()
creates a placeholder task
Definition flow_builder.hpp:820
Task emplace_on(C &&callable, D &&device)
creates a cudaFlow task on the given device
Definition cudaflow.hpp:1666
class to create a graph object
Definition graph.hpp:56
class to create a runtime object used by a runtime task
Definition graph.hpp:150
class to construct a subflow graph from the execution of a dynamic task
Definition flow_builder.hpp:889
void reset()
resets the subflow to a clean graph of joinable state
Definition flow_builder.hpp:1122
void named_silent_async(const std::string &name, F &&f, ArgsT &&... args)
similar to tf::Subflow::named_async but does not return a future object
Definition executor.hpp:1936
void join()
enables the subflow to join its parent task
Definition executor.hpp:1826
auto async(F &&f, ArgsT &&... args)
runs a given function asynchronously
Definition executor.hpp:1908
bool joinable() const noexcept
queries if the subflow is joinable
Definition flow_builder.hpp:1112
Executor & executor()
returns the executor that runs this subflow
Definition flow_builder.hpp:1117
void detach()
enables the subflow to detach from its parent task
Definition executor.hpp:1839
auto named_async(const std::string &name, F &&f, ArgsT &&... args)
runs the given function asynchronously and assigns the task a name
Definition executor.hpp:1854
void silent_async(F &&f, ArgsT &&... args)
similar to tf::Subflow::async but does not return a future object
Definition executor.hpp:1944
class to create a task handle over a node in a taskflow graph
Definition task.hpp:187
void for_each_dependent(V &&visitor) const
applies an visitor callable to each dependents of the task
Definition task.hpp:561
void for_each_successor(V &&visitor) const
applies an visitor callable to each successor of the task
Definition task.hpp:553
taskflow namespace
Definition small_vector.hpp:27