MCPcopy Create free account
hub / github.com/ROCm/clr / GetRootNodes

Method GetRootNodes

hipamd/src/hip_graph_internal.cpp:139–151  ·  view source on GitHub ↗

================================================================================================

Source from the content-addressed store, hash-verified

137
138// ================================================================================================
139std::vector<Node> Graph::GetRootNodes() const {
140 // root nodes are all vertices with 0 in-degrees
141 std::vector<Node> roots;
142
143 for (const auto& entry : vertices_) {
144 if (entry->GetInDegree() == 0) {
145 roots.push_back(entry);
146 ClPrint(amd::LOG_DETAIL_DEBUG, amd::LOG_CODE, "[hipGraph] Root node: %s(%p)",
147 GetGraphNodeTypeString(entry->GetType()), entry);
148 }
149 }
150 return roots;
151}
152
153// ================================================================================================
154// leaf nodes are all vertices with 0 out-degrees

Callers 2

hipGraphGetRootNodesFunction · 0.80

Calls 3

GetGraphNodeTypeStringFunction · 0.85
GetInDegreeMethod · 0.80
GetTypeMethod · 0.80

Tested by

no test coverage detected