Skip to content

Commit dff8197

Browse files
SWDEV-505276 - Parent graph of orig node and original graph of cloned node should be same.
Change-Id: I6ebc21cc42e41ad5d952a69fb3b3cb095f32cffb
1 parent d82d6a7 commit dff8197

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
@@ -2174,12 +2174,15 @@ hipError_t hipGraphNodeFindInClone(hipGraphNode_t* pNode, hipGraphNode_t origina
21742174
HIP_RETURN(hipErrorInvalidValue);
21752175
}
21762176
hip::Graph* iClonedGraph = reinterpret_cast<hip::Graph*>(clonedGraph);
2177-
if (iClonedGraph->getOriginalGraph() == nullptr) {
2177+
hip::GraphNode* iGraphnode = reinterpret_cast<hip::GraphNode*>(originalNode);
2178+
if (iClonedGraph->getOriginalGraph() == nullptr ||
2179+
// parent graph of orig node and original graph of cloned node should be same.
2180+
iClonedGraph->getOriginalGraph() != iGraphnode->GetParentGraph()) {
21782181
HIP_RETURN(hipErrorInvalidValue);
21792182
}
21802183

21812184
for (auto node : iClonedGraph->GetNodes()) {
2182-
if (node->GetID() == reinterpret_cast<hip::GraphNode*>(originalNode)->GetID()) {
2185+
if (node->GetID() == iGraphnode->GetID()) {
21832186
*pNode = reinterpret_cast<hipGraphNode_t>(node);
21842187
HIP_RETURN(hipSuccess);
21852188
}

0 commit comments

Comments
 (0)