diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index cf48db9062..46e73f96d2 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -201,7 +201,7 @@ hipError_t hipSignalExternalSemaphoresAsync( unsigned int numExtSems, hipStream_t stream ) { HIP_INIT_API(hipSignalExternalSemaphoresAsync, extSemArray, paramsArray, numExtSems, stream); - if (extSemArray == nullptr || paramsArray == nullptr) { + if (extSemArray == nullptr || paramsArray == nullptr || !hip::isValid(stream)) { HIP_RETURN(hipErrorInvalidValue); } hip::Stream* hip_stream = hip::getStream(stream); @@ -233,7 +233,7 @@ hipError_t hipWaitExternalSemaphoresAsync(const hipExternalSemaphore_t* extSemAr { HIP_INIT_API(hipWaitExternalSemaphoresAsync, extSemArray, paramsArray, numExtSems, stream); - if (extSemArray == nullptr || paramsArray == nullptr) { + if (extSemArray == nullptr || paramsArray == nullptr || !hip::isValid(stream)) { HIP_RETURN(hipErrorInvalidValue); } hip::Stream* hip_stream = hip::getStream(stream);