From bafdaa4f310241e8bba70dfb9795bef63eef7733 Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Tue, 8 Nov 2022 11:38:02 -0500 Subject: [PATCH] SWDEV-365587 - reuse the id from capturing stream Signed-off-by: sdashmiz Change-Id: I65f5be3fcc4cffcf3eb5762fd0b43fd051c145c2 [ROCm/clr commit: b665b9a6e88a76edd8327b1414e086821174400f] --- projects/clr/hipamd/src/hip_graph.cpp | 2 ++ projects/clr/hipamd/src/hip_internal.hpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 7d99ee3350..71b51112f5 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -774,6 +774,7 @@ hipError_t capturehipStreamWaitEvent(hipEvent_t& event, hipStream_t& stream, uns } if (!s->IsOriginStream()) { s->SetCaptureGraph(reinterpret_cast(e->GetCaptureStream())->GetCaptureGraph()); + s->SetCaptureId(reinterpret_cast(e->GetCaptureStream())->GetCaptureID()); s->SetCaptureMode(reinterpret_cast(e->GetCaptureStream())->GetCaptureMode()); s->SetParentStream(e->GetCaptureStream()); reinterpret_cast(s->GetParentStream())->SetParallelCaptureStream(stream); @@ -863,6 +864,7 @@ hipError_t hipStreamBeginCapture_common(hipStream_t stream, hipStreamCaptureMode } s->SetCaptureGraph(new ihipGraph()); + s->SetCaptureId(); s->SetCaptureMode(mode); s->SetOriginStream(); if (mode != hipStreamCaptureModeRelaxed) { diff --git a/projects/clr/hipamd/src/hip_internal.hpp b/projects/clr/hipamd/src/hip_internal.hpp index 60d584a9c9..6d009b2e50 100644 --- a/projects/clr/hipamd/src/hip_internal.hpp +++ b/projects/clr/hipamd/src/hip_internal.hpp @@ -338,9 +338,15 @@ namespace hip { void SetCaptureGraph(hipGraph_t pGraph) { pCaptureGraph_ = pGraph; captureStatus_ = hipStreamCaptureStatusActive; + } + void SetCaptureId() { // ID is generated in Begin Capture i.e.. when capture status is active captureID_ = GenerateCaptureID(); } + void SetCaptureId(unsigned long long captureId) { + // ID is given from parent stream + captureID_ = captureId; + } /// reset capture parameters hipError_t EndCapture(); /// Set capture status