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]
Dieser Commit ist enthalten in:
Rakesh Roy
2023-01-12 18:39:34 +05:30
committet von Rakesh Roy
Ursprung 61f59d2285
Commit 9045dbab4b
+2 -1
Datei anzeigen
@@ -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);