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) {