Cpp-Taskflow  2.1.0
tf::Framework Class Reference

A reusable task dependency graph. More...

#include <framework.hpp>

Inheritance diagram for tf::Framework:
Collaboration diagram for tf::Framework:

Public Member Functions

 Framework ()
 constructs the framework with an empty task dependency graph
 
virtual ~Framework ()
 destroy the framework (virtual call)
 
void dump (std::ostream &ostream) const
 dumps the framework to a std::ostream in DOT format More...
 
std::string dump () const
 dumps the framework in DOT format to a std::string
 
size_t num_nodes () const
 queries the number of nodes in the framework
 
- Public Member Functions inherited from tf::FlowBuilder
 FlowBuilder (Graph &)
 
template<typename C >
auto emplace (C &&callable)
 creates a 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 at one time More...
 
template<typename C >
auto silent_emplace (C &&callable)
 the same as tf::FlowBuilder::emplace (starting at 2.1.0)
 
template<typename... C, std::enable_if_t<(sizeof...(C)> 1>
auto silent_emplace (C &&... callables)
 the same as tf::FlowBuilder::emplace (starting at 2.1.0)
 
template<typename I , typename C >
std::pair< Task, Taskparallel_for (I beg, I end, C &&callable, size_t chunk=0)
 constructs a task dependency graph of range-based parallel_for More...
 
template<typename I , typename C , std::enable_if_t< std::is_arithmetic_v< I >, void > * = nullptr>
std::pair< Task, Taskparallel_for (I beg, I end, I step, C &&callable, size_t chunk=0)
 constructs a task dependency graph of 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 gather (std::vector< Task > &others, Task A)
 adds dependency links from many tasks to one task A More...
 
void gather (std::initializer_list< Task > others, Task A)
 adds dependency links from many tasks to one task A More...
 

Friends

template<template< typename... > typename E>
class BasicTaskflow
 
class Topology
 

Detailed Description

A reusable task dependency graph.

A framework is a task dependency graph that is independent of a taskflow object. You can run a framework multiple times from a taskflow object to enable a reusable control flow.

Member Function Documentation

◆ dump()

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

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

Parameters
ostreama std::ostream target

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