| 1950 | } |
| 1951 | |
| 1952 | hipError_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 | |
| 1985 | hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, |
| 1986 | hipGraph_t childGraph) { |
no test coverage detected