check if the input mode is valid, SWDEV-306130

Change-Id: I72fda84ca3159b00062d98d49be62cae48701a32


[ROCm/clr commit: bd719ceb20]
Этот коммит содержится в:
haoyuan2 authored and Hao Yuan committed 2021-12-28 21:09:31 -05:00
1 родитель 5cb71910d2
Коммит 95921782b0
1 file changed
+3 -1
+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());