From 3e1e2408a9d984f88c60e72aac7f9c0a53ab8574 Mon Sep 17 00:00:00 2001 From: "systems-assistant[bot]" <221163467+systems-assistant[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:57:33 +0530 Subject: [PATCH] SWDEV-541427 - Fix forked stream joining to parent stream that is not origin stream(BeginCaptureStream) (#449) Co-authored-by: Anusha GodavarthySurya Co-authored-by: systems-assistant[bot] Co-authored-by: Godavarthy Surya, Anusha --- projects/clr/hipamd/src/hip_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index 82ef2409db..4c99c0f340 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -490,7 +490,9 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig if (waitStream == nullptr) { return hipErrorInvalidHandle; } - if (!waitStream->IsOriginStream()) { + // Dont set when forked stream joins back to the parent + if (!waitStream->IsOriginStream() && + waitStream != reinterpret_cast(eventStream->GetParentStream())) { waitStream->SetCaptureGraph((eventStream)->GetCaptureGraph()); waitStream->SetCaptureId((eventStream)->GetCaptureID()); waitStream->SetCaptureMode((eventStream)->GetCaptureMode());