From 12ed697705739bc73bab9f092d707b2091cb6a11 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Wed, 18 Dec 2024 05:14:19 +0000 Subject: [PATCH] SWDEV-505205 - Fix hipStreamLegacy segfault with hipStreamWaitEvent. Change-Id: I17fdaf7ac323507f99a7c071066944296537489c [ROCm/clr commit: a05a02e527d56ee859d07e67143ad3130d3a16ca] --- projects/clr/hipamd/src/hip_stream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index 86ca4cbc29..b0c411efb1 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -487,7 +487,8 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig // If stream is capturing but event is not recorded on event's stream. return hipErrorStreamCaptureIsolation; } - if ((waitStream != nullptr) && (eventStream->DeviceId() == waitStream->DeviceId())) { + if ((waitStream != nullptr && stream != hipStreamLegacy) && + (eventStream->DeviceId() == waitStream->DeviceId())) { eventStream->GetDevice()->AddSafeStream(eventStream, waitStream); } }