3#include <ossia/dataflow/graph/graph_utils.hpp>
11 void operator()(graph_node& node)
16 assert(graph_util::can_execute(node, *g));
17 graph_util::exec_node(node, *g);
30 void operator()(graph_node& node)
37 assert(graph_util::can_execute(node, *g));
39 auto t0 = std::chrono::steady_clock::now();
40 graph_util::exec_node(node, *g);
41 auto t1 = std::chrono::steady_clock::now();
43 = std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count();
57struct node_exec_logger
60 ossia::logger_type&
logger;
62 void operator()(graph_node& node)
67 assert(graph_util::can_execute(node, *g));
69 graph_util::exec_node(node, *g);
71 graph_util::exec_node(node, *g, logger);
80struct node_exec_logger_bench
84 ossia::logger_type&
logger;
86 void operator()(graph_node& node)
93 assert(graph_util::can_execute(node, *g));
95 auto t0 = std::chrono::steady_clock::now();
97 graph_util::exec_node(node, *g);
99 graph_util::exec_node(node, *g, logger);
100 auto t1 = std::chrono::steady_clock::now();
102 = std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count();
112 graph_util::exec_node(node, *g);
114 graph_util::exec_node(node, *g, logger);
125 template <
typename Graph_T>
126 static_exec(Graph_T&)
130 template <
typename T>
131 void set_logger(
const T&)
134 template <
typename T>
135 void set_bench(
const T&)
139 template <
typename Graph_T,
typename Impl_T>
141 Graph_T& g, Impl_T& impl, execution_state& e,
142 std::vector<graph_node*>& active_nodes)
145 for(
auto node : active_nodes)
149 assert(graph_util::can_execute(*node, e));
150 graph_util::exec_node(*node, e);
160struct static_exec_bench
162 std::shared_ptr<bench_map> perf;
163 template <
typename Graph_T>
164 static_exec_bench(Graph_T&)
168 template <
typename T>
169 void set_logger(
const T&)
172 template <
typename T>
173 void set_bench(
const T& t)
178 template <
typename Graph_T,
typename Impl_T>
180 Graph_T& g, Impl_T& impl, execution_state& e,
181 std::vector<graph_node*>& active_nodes)
187 for(
auto node : active_nodes)
191 assert(graph_util::can_execute(*node, e));
192 auto t0 = std::chrono::steady_clock::now();
193 graph_util::exec_node(*node, e);
194 auto t1 = std::chrono::steady_clock::now();
196 = std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count();
206 for(
auto node : active_nodes)
210 assert(graph_util::can_execute(*node, e));
211 graph_util::exec_node(*node, e);
222struct static_exec_logger
224 template <
typename Graph_T>
225 static_exec_logger(Graph_T&)
228 template <
typename T>
229 void set_logger(
const T& t)
233 template <
typename T>
234 void set_bench(
const T& t)
238 std::shared_ptr<bench_map> perf;
239 std::shared_ptr<ossia::logger_type>
logger;
240 template <
typename Graph_T,
typename Impl_T>
242 Graph_T& g, Impl_T& impl, execution_state& e,
243 std::vector<graph_node*>& active_nodes)
246 for(
auto node : active_nodes)
250 assert(graph_util::can_execute(*node, e));
252 graph_util::exec_node(*node, e);
254 graph_util::exec_node(*node, e, *logger);
264struct static_exec_logger_bench
266 template <
typename T>
267 void set_logger(
const T& t)
271 template <
typename T>
272 void set_bench(
const T& t)
277 std::shared_ptr<bench_map> perf;
278 std::shared_ptr<ossia::logger_type>
logger;
280 template <
typename Graph_T>
281 static_exec_logger_bench(Graph_T&)
284 template <
typename Graph_T,
typename Impl_T>
286 Graph_T& g, Impl_T& impl, execution_state& e,
287 std::vector<graph_node*>& active_nodes)
293 for(
auto node : active_nodes)
297 assert(graph_util::can_execute(*node, e));
298 auto t0 = std::chrono::steady_clock::now();
300 graph_util::exec_node(*node, e);
302 graph_util::exec_node(*node, e, *logger);
303 auto t1 = std::chrono::steady_clock::now();
305 = std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count();
315 for(
auto node : active_nodes)
319 assert(graph_util::can_execute(*node, e));
321 graph_util::exec_node(*node, e);
323 graph_util::exec_node(*node, e, *logger);
spdlog::logger & logger() noexcept
Where the errors will be logged. Default is stderr.
Definition context.cpp:118