From fe3c0a3fdcbd0a652716837322503dde62be3c97 Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Wed, 7 Feb 2024 17:37:24 +0000 Subject: [PATCH] SWDEV-445084 - Add DEBUG_CLR_GRAPH_PACKET_CAPTURE support for hipGraphInstantiateWithFlags/Params Change-Id: I5096b4c8d73d1faf972dfd23ab86a53d888946c4 [ROCm/clr commit: d6bc40e822df31c947f676d0b39bbb0efee4727f] --- projects/clr/hipamd/src/hip_graph.cpp | 4 ---- projects/clr/hipamd/src/hip_graph_internal.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index dd2ead4937..fcd7cfd02e 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -1262,10 +1262,6 @@ hipError_t hipGraphInstantiate(hipGraphExec_t* pGraphExec, hipGraph_t graph, hipError_t status = ihipGraphInstantiate(&ge, reinterpret_cast(graph)); if (status == hipSuccess) { *pGraphExec = reinterpret_cast(ge); - if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) { - // For graph nodes capture AQL packets to dispatch them directly during graph launch. - status = ge->CaptureAQLPackets(); - } } HIP_RETURN(status); } diff --git a/projects/clr/hipamd/src/hip_graph_internal.cpp b/projects/clr/hipamd/src/hip_graph_internal.cpp index c164a8c55a..f0f9e71ce5 100644 --- a/projects/clr/hipamd/src/hip_graph_internal.cpp +++ b/projects/clr/hipamd/src/hip_graph_internal.cpp @@ -344,11 +344,18 @@ hipError_t GraphExec::Init() { for (auto& node : topoOrder_) { status = node->GetNumParallelStreams(min_num_streams); - if(status != hipSuccess) { + if (status != hipSuccess) { return status; } } status = CreateStreams(parallelLists_.size() - 1 + min_num_streams); + if (status != hipSuccess) { + return status; + } + if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) { + // For graph nodes capture AQL packets to dispatch them directly during graph launch. + status = CaptureAQLPackets(); + } return status; }