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

Function hipGraphGetRootNodes

hipamd/src/hip_graph.cpp:1683–1708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1681}
1682
1683hipError_t hipGraphGetRootNodes(hipGraph_t graph, hipGraphNode_t* pRootNodes,
1684 size_t* pNumRootNodes) {
1685 HIP_INIT_API(hipGraphGetRootNodes, graph, pRootNodes, pNumRootNodes);
1686
1687 if (graph == nullptr || pNumRootNodes == nullptr) {
1688 HIP_RETURN(hipErrorInvalidValue);
1689 }
1690 const std::vector<hip::GraphNode*> nodes = reinterpret_cast<hip::Graph*>(graph)->GetRootNodes();
1691 if (pRootNodes == nullptr) {
1692 *pNumRootNodes = nodes.size();
1693 HIP_RETURN(hipSuccess);
1694 } else if (*pNumRootNodes <= nodes.size()) {
1695 for (int i = 0; i < *pNumRootNodes; i++) {
1696 pRootNodes[i] = reinterpret_cast<hipGraphNode_t>(nodes[i]);
1697 }
1698 } else {
1699 for (int i = 0; i < nodes.size(); i++) {
1700 pRootNodes[i] = reinterpret_cast<hipGraphNode_t>(nodes[i]);
1701 }
1702 for (int i = nodes.size(); i < *pNumRootNodes; i++) {
1703 pRootNodes[i] = nullptr;
1704 }
1705 *pNumRootNodes = nodes.size();
1706 }
1707 HIP_RETURN(hipSuccess);
1708}
1709
1710hipError_t hipGraphKernelNodeGetParams(hipGraphNode_t node, hipKernelNodeParams* pNodeParams) {
1711 HIP_INIT_API(hipGraphKernelNodeGetParams, node, pNodeParams);

Callers

nothing calls this directly

Calls 2

GetRootNodesMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected