SWDEV-366974 - add proper error

- Null stream correct error when blocing stream is being captured

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I0d902a4f4ef02736a6db60ba7bffa7c20011bc84


[ROCm/clr commit: c5e7b56463]
This commit is contained in:
sdashmiz
2022-11-11 11:41:00 -05:00
committed by Shadi Dashmiz
parent 243d4dacd1
commit dc97f3719e
3 changed files with 16 additions and 0 deletions
+3
View File
@@ -807,6 +807,9 @@ hipError_t hipStreamIsCapturing_common(hipStream_t stream, hipStreamCaptureStatu
if (pCaptureStatus == nullptr || !hip::isValid(stream)) {
return hipErrorInvalidValue;
}
if (hip::Stream::StreamCaptureBlocking() == true && stream == nullptr) {
return hipErrorStreamCaptureImplicit;
}
if (stream == nullptr) {
*pCaptureStatus = hipStreamCaptureStatusNone;
} else {
+3
View File
@@ -295,6 +295,9 @@ namespace hip {
/// Sync all non-blocking streams
static void syncNonBlockingStreams(int deviceId);
/// Check whether any blocking stream running
static bool StreamCaptureBlocking();
/// Destroy all streams on a given device
static void destroyAllStreams(int deviceId);
+10
View File
@@ -180,6 +180,16 @@ void Stream::syncNonBlockingStreams(int deviceId) {
}
}
bool Stream::StreamCaptureBlocking() {
amd::ScopedLock lock(streamSetLock);
for (auto& it : streamSet) {
if (it->GetCaptureStatus() == hipStreamCaptureStatusActive && it->Flags() != hipStreamNonBlocking) {
return true;
}
}
return false;
}
void Stream::destroyAllStreams(int deviceId) {
std::vector<Stream*> toBeDeleted;
{