1#include <muda/compute_graph/compute_graph_var_manager.h>
2#include <muda/compute_graph/compute_graph.h>
6MUDA_INLINE span<const ComputeGraphDependency> ComputeGraphClosure::deps()
const
8 return m_graph->dep_span(m_deps_begin, m_deps_count);
10MUDA_INLINE
void ComputeGraphClosure::graphviz_id(std::ostream& o,
11 const ComputeGraphGraphvizOptions& options)
const
13 o <<
"node_g" << options.graph_id <<
"_n" << clousure_id();
16MUDA_INLINE
void ComputeGraphClosure::graphviz_def(std::ostream& o,
17 const ComputeGraphGraphvizOptions& options)
const
19 graphviz_id(o, options);
30 graphviz_id(o, options);
32 if(options.show_all_graph_nodes_in_a_closure)
36 for(
auto& node : m_graph_nodes)
39 if(&node != &m_graph_nodes.back())
45 if(options.show_all_graph_nodes_in_a_closure)
47 o << options.all_nodes_closure_style;
51 o << options.node_style;
56MUDA_INLINE
void ComputeGraphClosure::graphviz_var_usages(std::ostream& o,
57 const ComputeGraphGraphvizOptions& options)
const
59 for(
auto&& [var_id, usage] : var_usages())
61 auto var = m_graph->m_var_manager->m_vars[var_id.value()];
62 var->graphviz_id(o, options);
64 graphviz_id(o, options);
65 if(usage == ComputeGraphVarUsage::ReadWrite)
66 o <<
"[" << options.read_write_style <<
"]";
68 o <<
"[" << options.read_style <<
"]";
73MUDA_INLINE
void ComputeGraphClosure::set_deps_range(
size_t begin,
size_t count)