From 6258f8254ff79b18ed9bc3e1f8df3e2f87dc303e Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Tue, 22 Aug 2023 17:08:39 +0000 Subject: [PATCH] SWDEV-375596 - Device context should not be changed while graph exec update for graph nodes other than empty and host node. Change-Id: I89d734b111aae5b042386175d2786ce9002771b9 [ROCm/clr commit: d2655d84fde171231f1ab66a1b0fda24c629b448] --- projects/clr/hipamd/src/hip_graph.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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]);