diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/graph.hpp | 3 | ||||
-rw-r--r-- | host/lib/rfnoc/graph.cpp | 18 |
2 files changed, 17 insertions, 4 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/graph.hpp b/host/lib/include/uhdlib/rfnoc/graph.hpp index 288de63ce..73f983d41 100644 --- a/host/lib/include/uhdlib/rfnoc/graph.hpp +++ b/host/lib/include/uhdlib/rfnoc/graph.hpp @@ -171,6 +171,9 @@ private: void resolve_all_properties(uhd::rfnoc::resolve_context context, rfnoc_graph_t::vertex_descriptor initial_node); + void resolve_all_properties(uhd::rfnoc::resolve_context context, + node_ref_t initial_node); + /************************************************************************** * Action API *************************************************************************/ diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp index 1fc60cf6e..4041ece5a 100644 --- a/host/lib/rfnoc/graph.cpp +++ b/host/lib/rfnoc/graph.cpp @@ -89,11 +89,11 @@ void graph_t::connect(node_ref_t src_node, node_ref_t dst_node, graph_edge_t edg auto dst_vertex_desc = _node_map.at(dst_node); // Set resolver callbacks: - node_accessor.set_resolve_all_callback(src_node, [this, src_vertex_desc]() { - this->resolve_all_properties(resolve_context::NODE_PROP, src_vertex_desc); + node_accessor.set_resolve_all_callback(src_node, [this, src_node]() { + this->resolve_all_properties(resolve_context::NODE_PROP, src_node); }); - node_accessor.set_resolve_all_callback(dst_node, [this, dst_vertex_desc]() { - this->resolve_all_properties(resolve_context::NODE_PROP, dst_vertex_desc); + node_accessor.set_resolve_all_callback(dst_node, [this, dst_node]() { + this->resolve_all_properties(resolve_context::NODE_PROP, dst_node); }); // Set post action callbacks: node_accessor.set_post_action_callback( @@ -324,6 +324,9 @@ void graph_t::resolve_all_properties( auto begin_it = topo_sorted_nodes.begin(); auto end_it = topo_sorted_nodes.end(); while (*node_it != initial_node) { + if (node_it == end_it) { + throw uhd::rfnoc_error("Cannot find node in graph!"); + } // We know *node_it must be == initial_node at some point, because // otherwise, initial_dirty_nodes would have been empty node_it++; @@ -439,6 +442,13 @@ void graph_t::resolve_all_properties( } } +void graph_t::resolve_all_properties( + resolve_context context, node_ref_t initial_node) +{ + auto initial_node_vertex_desc = _node_map.at(initial_node); + resolve_all_properties(context, initial_node_vertex_desc); +} + void graph_t::enqueue_action( node_ref_t src_node, res_source_info src_edge, action_info::sptr action) { |