Peano
Loading...
Searching...
No Matches
dynamic_task_graph_node.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org. It
3// supplements something to oneTBB which has been removed and which I need:
4// dynamic tasking. Therefore I add it to the tbb namespace rather than
5// Peano's tarch.
6#pragma once
7
8
9#include <functional>
10#include <set>
11#include <memory>
12#include <string>
13
14
15namespace tbb {
16 class dynamic_task_graph_node;
17 class dynamic_task_graph_spawned_node;
18 class dynamic_task_graph;
19}
20
21namespace tbb {
27 public:
28 friend class dynamic_task_graph;
30
38 dynamic_task_graph_node( std::function<void()> functor );
39
43 dynamic_task_graph_node( std::function<void()> functor, const std::string& task_description );
44
54
62 void add_dependency( const dynamic_task_graph_node& node );
63
67 void add_dependencies( const std::set<dynamic_task_graph_node>& nodes );
68
76 bool is_submitted() const;
77
78 std::string to_string() const;
79
80 private:
81 std::function<void()> _functor;
82
83 std::shared_ptr<dynamic_task_graph_spawned_node> _spawned_task;
84
96 std::vector< std::shared_ptr<dynamic_task_graph_spawned_node> > _in_dependency;
97
98 #if TBB_USE_DEBUG>0
99 std::string _task_description;
100 #endif
101 };
102}
103
Represents one node in task graph.
bool is_submitted() const
Has task been submitted.
void add_dependencies(const std::set< dynamic_task_graph_node > &nodes)
Wrapper around add_dependency()
dynamic_task_graph_node(std::function< void()> functor)
Create new task graph node.
std::shared_ptr< dynamic_task_graph_spawned_node > _spawned_task
std::vector< std::shared_ptr< dynamic_task_graph_spawned_node > > _in_dependency
In dependencies.
void add_dependency(const dynamic_task_graph_node &node)
Add a single dependency.
Very simple dynamic task graph interface.
I've written an API to IIT, but I'm not currently using.