From 3dfef513b198cfadcfa0b47ee6173ef7e0855be4 Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Wed, 6 Dec 2023 22:35:13 +0000 Subject: [PATCH] SWDEV-433634 - Check Relaxed capture interaction mode for the thread - Allow capture to be less rectrictive if we set the global thread interaction mode for the thread. Change-Id: I84f65d9418ac26ada0477c85a45a3831c2351ce4 [ROCm/clr commit: 59a6a6c12eb0273d1d7d5f5af9f86c24a806e88a] --- projects/clr/hipamd/src/hip_stream.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index f325a7201d..8246cdbb27 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -169,6 +169,11 @@ void Stream::destroyAllStreams(int deviceId) { bool Stream::StreamCaptureOngoing(hipStream_t hStream) { hip::Stream* s = reinterpret_cast(hStream); + // Allow capture to be less restrictive one one changes the stream capture interaction + // mode for the thread + if (hip::tls.stream_capture_mode_ == hipStreamCaptureModeRelaxed) { + return false; + } // If any local thread has an ongoing or concurrent capture sequence initiated // with hipStreamCaptureModeGlobal, it is prohibited from unsafe calls if (s != nullptr && s->GetCaptureMode() == hipStreamCaptureModeGlobal) {