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
This commit is contained in:
Satyanvesh Dittakavi
2021-07-08 02:13:50 -04:00
parent e5a1f25424
commit 688288c2e3
+4 -4
View File
@@ -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<hip::Event*>(start);
hip::Event* eStop = reinterpret_cast<hip::Event*>(stop);