EXSWHTEC-1 - Implement additional negative parameter tests for hipIpcGetEventHandle and hipIpcOpenEventHandle (#2882)

このコミットが含まれているのは:
Mirza Halilčević
2022-11-04 14:54:28 +01:00
committed by GitHub
コミット 72ab04d18d
+25
ファイルの表示
@@ -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