Skip to content

Commit cd065d1

Browse files
jaydeeppatel1111satyanveshd
authored andcommitted
SWDEV-505276 - Parent graph of orig node and original graph of cloned node should be same.
Change-Id: I6ebc21cc42e41ad5d952a69fb3b3cb095f32cffb
1 parent cdd8a0a commit cd065d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hipamd/src/hip_graph.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,12 +2182,15 @@ hipError_t hipGraphNodeFindInClone(hipGraphNode_t* pNode, hipGraphNode_t origina
21822182
HIP_RETURN(hipErrorInvalidValue);
21832183
}
21842184
hip::Graph* iClonedGraph = reinterpret_cast<hip::Graph*>(clonedGraph);
2185-
if (iClonedGraph->getOriginalGraph() == nullptr) {
2185+
hip::GraphNode* iGraphnode = reinterpret_cast<hip::GraphNode*>(originalNode);
2186+
if (iClonedGraph->getOriginalGraph() == nullptr ||
2187+
// parent graph of orig node and original graph of cloned node should be same.
2188+
iClonedGraph->getOriginalGraph() != iGraphnode->GetParentGraph()) {
21862189
HIP_RETURN(hipErrorInvalidValue);
21872190
}
21882191

21892192
for (auto node : iClonedGraph->GetNodes()) {
2190-
if (node->GetID() == reinterpret_cast<hip::GraphNode*>(originalNode)->GetID()) {
2193+
if (node->GetID() == iGraphnode->GetID()) {
21912194
*pNode = reinterpret_cast<hipGraphNode_t>(node);
21922195
HIP_RETURN(hipSuccess);
21932196
}

0 commit comments

Comments
 (0)