HostEnvironmentDirectedGraph::Iterator #1273
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Branch named
host_graph_traverse
because I incorrectly thought this feature request was tree traversal for some reason, and created the branch before re-reading the issue.Required some modifications to
HostEnvironmentDirectedGraph::EdgeMap::Edge
andCUDAEnvironmentDirectedGraphBuffers
, as these were previously heavily written for Edges to be referred to by src/dest, rather than index, despite this requiring the index to be looked up by most methods.Reason this probably wasn't implemented initially is because the index of an edge is not stable, as the edge list is sorted each time the map is built. Likewise, it iterates the buffer of allocated edges, rather than the named
EdgeMap
so the iterator does not match expectations of a map iterator (e.g. doesn't return key-value pairs) and leads to some ambiguity (e.g. doessize()
return the length of the allocated buffer, or the number of valid edges?).Closes #1237