check if the input mode is valid, SWDEV-306130

Change-Id: I72fda84ca3159b00062d98d49be62cae48701a32
Этот коммит содержится в:
haoyuan2
2021-10-15 09:35:57 -07:00
коммит произвёл Hao Yuan
родитель a6b2294b93
Коммит bd719ceb20
+3 -1
Просмотреть файл
@@ -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());