diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index aea9a98482..511f28c030 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -2232,6 +2232,15 @@ hipError_t hipGraphExecUpdate(hipGraphExec_t hGraphExec, hipGraph_t hGraph, } for (std::vector::size_type i = 0; i != newGraphNodes.size(); i++) { if (newGraphNodes[i]->GetType() == oldGraphExecNodes[i]->GetType()) { + if (newGraphNodes[i]->GetType() != hipGraphNodeTypeHost && + newGraphNodes[i]->GetType() != hipGraphNodeTypeEmpty) { + if (newGraphNodes[i]->GetParentGraph()->device_ != + oldGraphExecNodes[i]->GetParentGraph()->device_) { + *updateResult_out = hipGraphExecUpdateErrorUnsupportedFunctionChange; + *hErrorNode_out = reinterpret_cast(newGraphNodes[i]); + return hipErrorGraphExecUpdateFailure; + } + } hipError_t status = oldGraphExecNodes[i]->SetParams(newGraphNodes[i]); if (status != hipSuccess) { *hErrorNode_out = reinterpret_cast(newGraphNodes[i]);