From 09a081235c017e1b5f49e6bc690cd231b0cd203a Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Mon, 10 Apr 2023 07:00:31 +0000 Subject: [PATCH] SWDEV-391731 - Check thread local list too. With global flag, In addition to global vector, we need to check thread local vector too. If both of them are empty then only return false. Change-Id: I3a24d16a35c702b34b9a8867dc410ebd80108f25 --- hipamd/src/hip_stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hipamd/src/hip_stream.cpp b/hipamd/src/hip_stream.cpp index 7d107c16e7..d9bc512181 100644 --- a/hipamd/src/hip_stream.cpp +++ b/hipamd/src/hip_stream.cpp @@ -173,7 +173,7 @@ bool Stream::StreamCaptureOngoing(hipStream_t hStream) { // with hipStreamCaptureModeGlobal, it is prohibited from unsafe calls if (s != nullptr && s->GetCaptureMode() == hipStreamCaptureModeGlobal) { amd::ScopedLock lock(g_captureStreamsLock); - return (g_captureStreams.empty() == true) ? false : true; + return (g_captureStreams.empty() == true && hip::tls.capture_streams_.empty()) ? false : true; } else { amd::ScopedLock lock(g_streamSetLock);