SWDEV-374369 - Fix hipGraphAdd*Node* APIs invalid behavior

- Return hipErrorInvalidValue if dependencies array contains a node from
  different graph

Change-Id: I0dcfaaaeb50a89848ac546a0b86b185977e2128c


[ROCm/clr commit: a427d3cd10]
Αυτή η υποβολή περιλαμβάνεται σε:
Rakesh Roy authored and Rakesh Roy committed 2023-01-13 12:09:42 -05:00
1 γονέας 61f59d2285
υποβολή 9045dbab4b
1 file changed
+2 -1
@@ -32,7 +32,8 @@ inline hipError_t ihipGraphAddNode(hipGraphNode_t graphNode, hipGraph_t graph,
const hipGraphNode_t* pDependencies, size_t numDependencies) {
graph->AddNode(graphNode);
for (size_t i = 0; i < numDependencies; i++) {
if (!hipGraphNode::isNodeValid(pDependencies[i])) {
if ((!hipGraphNode::isNodeValid(pDependencies[i])) ||
(graph != pDependencies[i]->GetParentGraph())) {
return hipErrorInvalidValue;
}
pDependencies[i]->AddEdge(graphNode);