check if the input mode is valid, SWDEV-306130

Change-Id: I72fda84ca3159b00062d98d49be62cae48701a32


[ROCm/clr commit: bd719ceb20]
Bu işleme şunda yer alıyor:
haoyuan2
2021-10-15 09:35:57 -07:00
işlemeyi yapan: Hao Yuan
ebeveyn 5cb71910d2
işleme 95921782b0
+3 -1
Dosyayı Görüntüle
@@ -700,7 +700,9 @@ hipError_t hipStreamBeginCapture(hipStream_t stream, hipStreamCaptureMode mode)
hip::Stream* s = reinterpret_cast<hip::Stream*>(stream);
// capture cannot be initiated on legacy stream
// It can be initiated if the stream is not already in capture mode
if (stream == nullptr || s->GetCaptureStatus() == hipStreamCaptureStatusActive) {
if (stream == nullptr ||
(mode < hipStreamCaptureModeGlobal || mode > hipStreamCaptureModeRelaxed) ||
s->GetCaptureStatus() == hipStreamCaptureStatusActive) {
HIP_RETURN(hipErrorInvalidValue);
}
s->SetCaptureGraph(new ihipGraph());