Loading...
Searching...
No Matches
module.hpp
1#pragma once
2
3#include "../taskflow.hpp"
4
9
10namespace tf {
11
12// ----------------------------------------------------------------------------
13
14template <typename T>
15auto 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
73template <typename T>
74auto make_module_task(T& graph) {
75 return Algorithm::make_module_task(graph);
76}
77
78} // end of namespact tf -----------------------------------------------------
taskflow namespace
Definition small_vector.hpp:20
auto make_module_task(T &graph)
creates a module task using the given graph
Definition module.hpp:74
Graph & retrieve_graph(T &t)
retrieves a reference to the underlying tf::Graph from an object
Definition graph.hpp:975