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

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

Change-Id: I0dcfaaaeb50a89848ac546a0b86b185977e2128c
Этот коммит содержится в:
Rakesh Roy
2023-01-12 18:39:34 +05:30
коммит произвёл Rakesh Roy
родитель 2228383fcb
Коммит a427d3cd10
+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);