From 688288c2e3e6c4c9ffd73f3d20feb1fe658b71ce Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi Date: Thu, 8 Jul 2021 02:13:50 -0400 Subject: [PATCH] SWDEV-1 - Rearrange error conditions in elapsed time - when the first argument is null API should return hipErrorInvalidValue - but when first and second argument both are null API was returning hipErrorInvalidHandle causing catch2 event tests to fail Change-Id: I0978ce8b8462e4baa043be75a40b5bc45b036bb6 --- hipamd/src/hip_event.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hipamd/src/hip_event.cpp b/hipamd/src/hip_event.cpp index 855dca47af..1ac62186b8 100755 --- a/hipamd/src/hip_event.cpp +++ b/hipamd/src/hip_event.cpp @@ -259,14 +259,14 @@ hipError_t hipEventDestroy(hipEvent_t event) { hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop) { HIP_INIT_API(hipEventElapsedTime, ms, start, stop); - if (start == nullptr || stop == nullptr) { - HIP_RETURN(hipErrorInvalidHandle); - } - if (ms == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + if (start == nullptr || stop == nullptr) { + HIP_RETURN(hipErrorInvalidHandle); + } + hip::Event* eStart = reinterpret_cast(start); hip::Event* eStop = reinterpret_cast(stop);