Taskflow  2.4-master-branch
tf::Taskflow Class Reference

main entry to create a task dependency graph More...

#include <taskflow.hpp>

Inheritance diagram for tf::Taskflow:
Collaboration diagram for tf::Taskflow:

Public Member Functions

 Taskflow (const std::string &name)
 constructs a taskflow with a given name
 
 Taskflow ()
 constructs a taskflow
 
virtual ~Taskflow ()
 destroy the taskflow (virtual call)
 
void dump (std::ostream &ostream) const
 dumps the taskflow to a std::ostream in DOT format More...
 
std::string dump () const
 dumps the taskflow in DOT format to a std::string
 
size_t num_tasks () const
 queries the number of tasks in the taskflow
 
bool empty () const
 queries the emptiness of the taskflow
 
void name (const std::string &)
 sets the name of the taskflow More...
 
const std::stringname () const
 queries the name of the taskflow
 
void clear ()
 clears the associated task dependency graph
 
template<typename V >
void for_each_task (V &&visitor) const
 applies an visitor callable to each task in the taskflow
 
- Public Member Functions inherited from tf::FlowBuilder
 FlowBuilder (Graph &graph)
 constructs a flow builder object More...
 
template<typename C >
std::enable_if_t< is_static_task_v< C >, Taskemplace (C &&callable)
 creates a static task from a given callable object More...
 
template<typename C >
std::enable_if_t< is_dynamic_task_v< C >, Taskemplace (C &&callable)
 creates a dynamic task from a given callable object More...
 
template<typename C >
std::enable_if_t< is_condition_task_v< C >, Taskemplace (C &&callable)
 creates a condition task from a given callable object More...
 
template<typename C >
std::enable_if_t< is_cudaflow_task_v< C >, Taskemplace (C &&callable)
 creates a cudaflow task from a given callable object More...
 
template<typename... C, std::enable_if_t<(sizeof...(C)> 1>
auto emplace (C &&... callables)
 creates multiple tasks from a list of callable objects More...
 
Task composed_of (Taskflow &taskflow)
 creates a module task from a taskflow More...
 
template<typename I , typename C >
std::pair< Task, Taskparallel_for (I beg, I end, C &&callable, size_t chunk=1)
 constructs a task dependency graph of range-based parallel_for More...
 
template<typename I , typename C , std::enable_if_t< std::is_integral< std::decay_t< I >>::value, void > * = nullptr>
std::pair< Task, Taskparallel_for (I beg, I end, I step, C &&callable, size_t chunk=1)
 constructs a task dependency graph of integer index-based parallel_for More...
 
template<typename I , typename C , std::enable_if_t< std::is_floating_point< std::decay_t< I >>::value, void > * = nullptr>
std::pair< Task, Taskparallel_for (I beg, I end, I step, C &&callable, size_t chunk=1)
 constructs a task dependency graph of floating index-based parallel_for More...
 
template<typename I , typename T , typename B >
std::pair< Task, Taskreduce (I beg, I end, T &result, B &&bop)
 construct a task dependency graph of parallel reduction More...
 
template<typename I , typename T >
std::pair< Task, Taskreduce_min (I beg, I end, T &result)
 constructs a task dependency graph of parallel reduction through std::min More...
 
template<typename I , typename T >
std::pair< Task, Taskreduce_max (I beg, I end, T &result)
 constructs a task dependency graph of parallel reduction through std::max More...
 
template<typename I , typename T , typename B , typename U >
std::pair< Task, Tasktransform_reduce (I beg, I end, T &result, B &&bop, U &&uop)
 constructs a task dependency graph of parallel transformation and reduction More...
 
template<typename I , typename T , typename B , typename P , typename U >
std::pair< Task, Tasktransform_reduce (I beg, I end, T &result, B &&bop1, P &&bop2, U &&uop)
 constructs a task dependency graph of parallel transformation and reduction More...
 
Task placeholder ()
 creates an empty task More...
 
void precede (Task A, Task B)
 adds a dependency link from task A to task B More...
 
void linearize (std::vector< Task > &tasks)
 adds adjacent dependency links to a linear list of tasks More...
 
void linearize (std::initializer_list< Task > tasks)
 adds adjacent dependency links to a linear list of tasks More...
 
void broadcast (Task A, std::vector< Task > &others)
 adds dependency links from one task A to many tasks More...
 
void broadcast (Task A, std::initializer_list< Task > others)
 adds dependency links from one task A to many tasks More...
 
void succeed (std::vector< Task > &others, Task A)
 adds dependency links from many tasks to one task A More...
 
void succeed (std::initializer_list< Task > others, Task A)
 adds dependency links from many tasks to one task A More...
 

Friends

class Topology
 
class Executor
 
class FlowBuilder
 

Detailed Description

main entry to create a task dependency graph

Member Function Documentation

◆ dump()

void tf::Taskflow::dump ( std::ostream ostream) const
inline

dumps the taskflow to a std::ostream in DOT format

Parameters
ostreama std::ostream target

◆ name()

void tf::Taskflow::name ( const std::string name)
inline

sets the name of the taskflow

Returns
*this

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