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:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user