SWDEV-331301 - Fixes to return error if the childGraph topologies of instantiated childGraphNode and to-be updated childGraphNode do not match

Change-Id: I372317a4df13e5cd352f46525d820246fe4ca8f2
Tento commit je obsažen v:
Sourabh Betigeri
2022-05-26 17:52:24 -07:00
odevzdal Sourabh Betigeri
rodič 112b6370a5
revize c3db564e94
+17 -7
Zobrazit soubor
@@ -1279,13 +1279,23 @@ hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGra
HIP_RETURN(hipErrorUnknown);
}
hipGraphNode_t hipErrorNode_out;
hipGraphExecUpdateResult updateResult_out;
// Check if this instantiated graph is updatable. All restrictions in hipGraphExecUpdate() apply.
hipError_t status =
hipGraphExecUpdate(hGraphExec, childGraph, &hipErrorNode_out, &updateResult_out);
if (status != hipSuccess) {
HIP_RETURN(status);
// Validate whether the topology of node and childGraph matches
std::vector<Node> childGraphNodes1;
node->LevelOrder(childGraphNodes1);
std::vector<Node> childGraphNodes2;
childGraph->LevelOrder(childGraphNodes2);
if (childGraphNodes1.size() != childGraphNodes2.size()) {
HIP_RETURN(hipErrorUnknown);
}
// Validate if the node insertion order matches
else {
for (std::vector<Node>::size_type i = 0; i != childGraphNodes1.size(); i++) {
if (childGraphNodes1[i]->GetType() != childGraphNodes2[i]->GetType()) {
HIP_RETURN(hipErrorUnknown);
}
}
}
hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(node);