From 47ae1f1fffabd8f548ffde68620292a8b7d49068 Mon Sep 17 00:00:00 2001 From: agunashe Date: Thu, 13 Oct 2022 17:10:38 -0700 Subject: [PATCH] SWDEV-337331 - Windows graph fix Unit_hipGraphNodeGetDependentNodes_Functional Unit_hipGraphNodeGetDependencies_Functional Unit_hipGraphAddEventRecordNode_Functional_WithoutFlags Unit_hipGraphMemcpyNodeSetParams_Functional Unit_hipGraphExecChildGraphNodeSetParams_ChildTopology Change-Id: I762776d33f27197bcc012951a1828d3d1d2b3e2e --- hipamd/src/hip_graph_internal.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_graph_internal.cpp b/hipamd/src/hip_graph_internal.cpp index 8a93f1c1f5..e57d55be31 100644 --- a/hipamd/src/hip_graph_internal.cpp +++ b/hipamd/src/hip_graph_internal.cpp @@ -621,7 +621,7 @@ void ihipGraph::LevelOrder(std::vector& levelOrder) { GetGraphNodeTypeString((*it)->GetType()), *it, (*it)->GetLevel()); } while (!q.empty()) { - Node& node = q.front(); + Node node = q.front(); q.pop(); levelOrder.push_back(node); for (const auto& i : node->GetEdges()) { @@ -763,7 +763,12 @@ hipError_t FillCommands(std::vector>& parallelLists, first = false; continue; } - graphLastCmdWaitList.push_back(singleList.back()->GetCommands().back()); + if (!singleList.empty()) { + auto commands = singleList.back()->GetCommands(); + if (!commands.empty()) { + graphLastCmdWaitList.push_back(commands.back()); + } + } } if (!graphLastCmdWaitList.empty()) { endCommand = new amd::Marker(*queue, false, graphLastCmdWaitList);