From abaf29d0b6cbaf83c1315b3550a55008bfebcf60 Mon Sep 17 00:00:00 2001 From: "systems-assistant[bot]" <221163467+systems-assistant[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 21:20:21 +0100 Subject: [PATCH] SWDEV-537855 - Add hipEventDestroy (#554) Co-authored-by: Vladana Stojiljkovic --- .../catch/multiproc/hipIpcEventHandle.cc | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/projects/hip-tests/catch/multiproc/hipIpcEventHandle.cc b/projects/hip-tests/catch/multiproc/hipIpcEventHandle.cc index 80f8530787..e86f787598 100644 --- a/projects/hip-tests/catch/multiproc/hipIpcEventHandle.cc +++ b/projects/hip-tests/catch/multiproc/hipIpcEventHandle.cc @@ -337,12 +337,14 @@ TEST_CASE("Unit_hipIpcEventHandle_ParameterValidation") { hipEvent_t event; hipIpcEventHandle_t eventHandle; hipError_t ret; - HIP_CHECK(hipEventCreateWithFlags(&event, hipEventDisableTiming | hipEventInterprocess)); + #if HT_AMD // Test disabled for nvidia due to segfault with cuda api SECTION("Get event handle with eventHandle(nullptr)") { + HIP_CHECK(hipEventCreateWithFlags(&event, hipEventDisableTiming | hipEventInterprocess)); ret = hipIpcGetEventHandle(nullptr, event); REQUIRE(ret == hipErrorInvalidValue); + HIP_CHECK(hipEventDestroy(event)); } #endif @@ -362,27 +364,24 @@ TEST_CASE("Unit_hipIpcEventHandle_ParameterValidation") { } SECTION("Get event handle for event allocated without Interprocess flag") { - hipEvent_t eventNoIpc; - HIP_CHECK(hipEventCreateWithFlags(&eventNoIpc, hipEventDisableTiming)); + HIP_CHECK(hipEventCreateWithFlags(&event, hipEventDisableTiming)); - ret = hipIpcGetEventHandle(&eventHandle, eventNoIpc); + ret = hipIpcGetEventHandle(&eventHandle, event); if ((ret != hipErrorInvalidResourceHandle) && (ret != hipErrorInvalidConfiguration)) { INFO("Error returned : " << ret); REQUIRE(false); } - HIP_CHECK(hipEventDestroy(eventNoIpc)); + HIP_CHECK(hipEventDestroy(event)); } SECTION("Open event handle with event(nullptr)") { - hipIpcEventHandle_t ipc_handle{}; - ret = hipIpcOpenEventHandle(nullptr, ipc_handle); + ret = hipIpcOpenEventHandle(nullptr, eventHandle); REQUIRE(ret == hipErrorInvalidValue); } SECTION("Open event handle with eventHandle as invalid") { hipIpcEventHandle_t ipc_handle{}; - hipEvent_t eventOut; - ret = hipIpcOpenEventHandle(&eventOut, ipc_handle); + ret = hipIpcOpenEventHandle(&event, ipc_handle); if ((ret != hipErrorInvalidValue) && (ret != hipErrorMapFailed)) { INFO("Error returned : " << ret); REQUIRE(false); @@ -390,22 +389,18 @@ TEST_CASE("Unit_hipIpcEventHandle_ParameterValidation") { } SECTION("Open handle in process that created it") { - hipIpcEventHandle_t event_handle; hipEvent_t event1, event2; HIP_CHECK(hipEventCreateWithFlags(&event1, hipEventDisableTiming | hipEventInterprocess)); - HIP_CHECK(hipIpcGetEventHandle(&event_handle, event1)); - HIP_CHECK_ERROR(hipIpcOpenEventHandle(&event2, event_handle), hipErrorInvalidContext); + HIP_CHECK(hipIpcGetEventHandle(&eventHandle, event1)); + HIP_CHECK_ERROR(hipIpcOpenEventHandle(&event2, eventHandle), hipErrorInvalidContext); HIP_CHECK(hipEventDestroy(event1)); } // Disabled on AMD because of return value mismatch - EXSWHTEC-41 #if HT_NVIDIA SECTION("Event created with no flags") { - hipEvent_t event; - hipIpcEventHandle_t event_handle; - HIP_CHECK(hipEventCreate(&event)); - HIP_CHECK_ERROR(hipIpcGetEventHandle(&event_handle, event), hipErrorInvalidResourceHandle); + HIP_CHECK_ERROR(hipIpcGetEventHandle(&eventHandle, event), hipErrorInvalidResourceHandle); HIP_CHECK(hipEventDestroy(event)); } #endif