SWDEV-326793 - hipStreamGetFlags should query the flags for null stream

Change-Id: I1d1b833704c135b5a0c695b244380ac6c5b8438e


[ROCm/clr commit: 0af8904b87]
This commit is contained in:
Satyanvesh Dittakavi
2022-03-24 11:08:54 +00:00
parent 2442d41e31
commit 34e1d885a5
+9 -4
View File
@@ -384,11 +384,16 @@ hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPrio
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags) {
HIP_INIT_API(hipStreamGetFlags, stream, flags);
if ((flags != nullptr) && (stream != nullptr)) {
if (!hip::isValid(stream)) {
HIP_RETURN(hipErrorContextIsDestroyed);
if (flags != nullptr) {
if (stream == nullptr) {
// hipStreamDefault
*flags = 0;
} else {
if (!hip::isValid(stream)) {
HIP_RETURN(hipErrorContextIsDestroyed);
}
*flags = reinterpret_cast<hip::Stream*>(stream)->Flags();
}
*flags = reinterpret_cast<hip::Stream*>(stream)->Flags();
} else {
HIP_RETURN(hipErrorInvalidValue);
}