diff --git a/catch/multiproc/hipIpcEventHandle.cc b/catch/multiproc/hipIpcEventHandle.cc index 78b12bdff3..440b00f598 100644 --- a/catch/multiproc/hipIpcEventHandle.cc +++ b/catch/multiproc/hipIpcEventHandle.cc @@ -321,6 +321,10 @@ TEST_CASE("Unit_hipIpcEventHandle_ParameterValidation") { REQUIRE(ret == hipErrorInvalidValue); } + SECTION("Get event handle with handle == nullptr and event == nullptr") { + HIP_CHECK_ERROR(hipIpcGetEventHandle(nullptr, nullptr), hipErrorInvalidValue); + } + SECTION("Get event handle with invalid event object") { hipEvent_t eventUninit{}; ret = hipIpcGetEventHandle(&eventHandle, eventUninit); @@ -354,6 +358,27 @@ TEST_CASE("Unit_hipIpcEventHandle_ParameterValidation") { REQUIRE(false); } } + + 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(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(hipEventDestroy(event)); + } +#endif } #endif