| Taskflow: A General-purpose Task-parallel Programming System

Loading...
Searching...
No Matches
module.hpp
1#pragma once
2
3#include "../taskflow.hpp"
4
10 namespace tf {
11
12// ----------------------------------------------------------------------------
13
14 template <GraphLike T>
15 auto Algorithm::make_module_task(T& target) {
16 return [&graph=retrieve_graph(target)](tf::Runtime& rt){
17 if(graph.empty()) {
18 return;
19 }
20 rt._executor._schedule_graph(rt._worker, graph, rt._node->_topology, rt._node);
21 };
22}
23
24// ----------------------------------------------------------------------------
25
73 template <GraphLike T>
74 auto make_module_task(T& target) {
75 return Algorithm::make_module_task(target);
76}
77
78} // end of namespact tf -----------------------------------------------------
79
80
81
tf::Runtime
class to create a runtime task
Definition runtime.hpp:47
tf
taskflow namespace
Definition small_vector.hpp:20
tf::make_module_task
auto make_module_task(T &target)
creates a module task using the given graph
Definition module.hpp:74
tf::retrieve_graph
Graph & retrieve_graph(T &target)
retrieves a reference to the underlying tf::Graph from an object
Definition graph.hpp:1067