diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index e861951ced..3975c1e0ca 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -678,10 +678,14 @@ hipError_t capturehipLaunchHostFunc(hipStream_t& stream, hipHostFn_t& fn, void*& hipError_t hipStreamIsCapturing(hipStream_t stream, hipStreamCaptureStatus* pCaptureStatus) { HIP_INIT_API(hipStreamIsCapturing, stream, pCaptureStatus); - if (stream == nullptr || !hip::isValid(stream)) { + if (pCaptureStatus == nullptr || !hip::isValid(stream)) { HIP_RETURN(hipErrorInvalidValue); } - *pCaptureStatus = reinterpret_cast(stream)->GetCaptureStatus(); + if (stream == nullptr) { + *pCaptureStatus = hipStreamCaptureStatusNone; + } else { + *pCaptureStatus = reinterpret_cast(stream)->GetCaptureStatus(); + } HIP_RETURN(hipSuccess); }