================================================================================================
| 137 | |
| 138 | // ================================================================================================ |
| 139 | std::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 |
no test coverage detected