SWDEV-375596 - Device context should not be changed while graph exec update for graph nodes other than empty and host node.

Change-Id: I89d734b111aae5b042386175d2786ce9002771b9
This commit is contained in:
Jaydeep Patel
2023-08-22 17:08:39 +00:00
committed by Jaydeepkumar Patel
parent 1ec0ba3537
commit d2655d84fd
+9
View File
@@ -2232,6 +2232,15 @@ hipError_t hipGraphExecUpdate(hipGraphExec_t hGraphExec, hipGraph_t hGraph,
}
for (std::vector<hip::GraphNode*>::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<hipGraphNode_t>(newGraphNodes[i]);
return hipErrorGraphExecUpdateFailure;
}
}
hipError_t status = oldGraphExecNodes[i]->SetParams(newGraphNodes[i]);
if (status != hipSuccess) {
*hErrorNode_out = reinterpret_cast<hipGraphNode_t>(newGraphNodes[i]);