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: 59a6a6c12e]
This commit is contained in:
Saleel Kudchadker
2023-12-06 22:35:13 +00:00
förälder 1868de1f7d
incheckning 3dfef513b1
+5
Visa fil
@@ -169,6 +169,11 @@ void Stream::destroyAllStreams(int deviceId) {
bool Stream::StreamCaptureOngoing(hipStream_t hStream) {
hip::Stream* s = reinterpret_cast<hip::Stream*>(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) {