From 381f9d9e99ca620565f02524c7fa08bbc7cbe5f4 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Mon, 15 Jan 2024 16:42:56 +0000 Subject: [PATCH] SWDEV-441106 - Fixed Unit_hipEventElapsedTime_NullCheck Change-Id: Ie796d1b62ab3620104eeb3582cc6c9e52c335f36 --- catch/unit/event/Unit_hipEventElapsedTime.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/catch/unit/event/Unit_hipEventElapsedTime.cc b/catch/unit/event/Unit_hipEventElapsedTime.cc index d19d362152..21e66f97a6 100644 --- a/catch/unit/event/Unit_hipEventElapsedTime.cc +++ b/catch/unit/event/Unit_hipEventElapsedTime.cc @@ -57,7 +57,10 @@ THE SOFTWARE. * - HIP_VERSION >= 5.2 */ TEST_CASE("Unit_hipEventElapsedTime_NullCheck") { - hipEvent_t start = nullptr, end = nullptr; + hipEvent_t start, end; + HIP_CHECK(hipEventCreate(&start)); + HIP_CHECK(hipEventCreate(&end)); + float tms = 1.0f; HIP_ASSERT(hipEventElapsedTime(nullptr, start, end) == hipErrorInvalidValue); #ifndef __HIP_PLATFORM_NVIDIA__ @@ -65,6 +68,8 @@ TEST_CASE("Unit_hipEventElapsedTime_NullCheck") { HIP_ASSERT(hipEventElapsedTime(&tms, nullptr, end) == hipErrorInvalidHandle); HIP_ASSERT(hipEventElapsedTime(&tms, start, nullptr) == hipErrorInvalidHandle); #endif + HIP_CHECK(hipEventDestroy(start)); + HIP_CHECK(hipEventDestroy(end)); } /**