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

Function validateChildGraphNodeSetParams

hipamd/src/hip_graph.cpp:1952–1983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1950}
1951
1952hipError_t validateChildGraphNodeSetParams(hip::GraphNode* n, hip::Graph* cg, bool exec = true) {
1953 if (cg == nullptr || n == nullptr || !hip::GraphNode::isNodeValid(n) ||
1954 !hip::Graph::isGraphValid(cg) || n->GetType() != hipGraphNodeTypeGraph) {
1955 return hipErrorInvalidValue;
1956 }
1957 // compare with parent graph fron cloned and original node
1958 if (cg == n->GetParentGraph()->getOriginalGraph() || cg == n->GetParentGraph()) {
1959 return hipErrorUnknown;
1960 }
1961
1962 if (exec) { // validation only required for ExecnNodeSetParams
1963 // Validate whether the topology of node and childGraph matches
1964 std::vector<hip::GraphNode*> childGraphNodes1;
1965 n->TopologicalOrder(childGraphNodes1);
1966
1967 std::vector<hip::GraphNode*> childGraphNodes2;
1968 cg->TopologicalOrder(childGraphNodes2);
1969
1970 if (childGraphNodes1.size() != childGraphNodes2.size()) {
1971 return hipErrorUnknown;
1972 }
1973 // Validate if the node insertion order matches
1974 else {
1975 for (std::vector<hip::GraphNode*>::size_type i = 0; i != childGraphNodes1.size(); i++) {
1976 if (childGraphNodes1[i]->GetType() != childGraphNodes2[i]->GetType()) {
1977 return hipErrorUnknown;
1978 }
1979 }
1980 }
1981 }
1982 return hipSuccess;
1983}
1984
1985hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node,
1986 hipGraph_t childGraph) {

Callers 2

ihipGraphNodeSetParamsFunction · 0.85

Calls 5

GetTypeMethod · 0.80
getOriginalGraphMethod · 0.80
GetParentGraphMethod · 0.80
TopologicalOrderMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected