Skip to content

Commit

Permalink
Fix zeEventPoolCloseIpcHandle closing twice error
Browse files Browse the repository at this point in the history
Signed-off-by: davidoli <[email protected]>
  • Loading branch information
dmichaelo1 authored and bmyates committed Jul 23, 2021
1 parent 388ca58 commit 683766e
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 192 deletions.
21 changes: 16 additions & 5 deletions conformance_tests/tools/tracing/src/test_api_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ class TracingPrologueEpilogueTests : public ::testing::Test {
ze_image_region_t image_region;

ze_event_pool_handle_t event_pool = nullptr;
ze_event_pool_desc_t event_pool_desc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC,
nullptr,
ZE_EVENT_POOL_FLAG_HOST_VISIBLE, 1};
ze_event_pool_desc_t event_pool_desc = {
ZE_STRUCTURE_TYPE_EVENT_POOL_DESC, nullptr,
ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_IPC, 1};
ze_event_handle_t event = nullptr;
ze_event_desc_t event_desc = {ZE_STRUCTURE_TYPE_EVENT_DESC, nullptr};

Expand Down Expand Up @@ -1436,10 +1436,21 @@ TEST_F(

init_event_pool();

ze_result_t initial_result = zeEventPoolCloseIpcHandle(event_pool);
ze_ipc_event_pool_handle_t handle;
ze_event_pool_handle_t event_pool2;
ASSERT_EQ(ZE_RESULT_SUCCESS, zeEventPoolGetIpcHandle(event_pool, &ipc_event));
ASSERT_EQ(ZE_RESULT_SUCCESS,
zeEventPoolOpenIpcHandle(context, ipc_event, &event_pool2));

ze_result_t initial_result = zeEventPoolCloseIpcHandle(event_pool2);

ready_tracer(tracer_handle, prologues, epilogues);

ASSERT_EQ(initial_result, zeEventPoolCloseIpcHandle(event_pool));
ASSERT_EQ(ZE_RESULT_SUCCESS, zeEventPoolGetIpcHandle(event_pool, &ipc_event));
ASSERT_EQ(ZE_RESULT_SUCCESS,
zeEventPoolOpenIpcHandle(context, ipc_event, &event_pool2));

ASSERT_EQ(initial_result, zeEventPoolCloseIpcHandle(event_pool2));
}

TEST_F(
Expand Down
21 changes: 16 additions & 5 deletions layer_tests/tracing/src/test_api_ltracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ class LTracingPrologueEpilogueTests : public ::testing::Test {
ze_image_region_t image_region;

ze_event_pool_handle_t event_pool = nullptr;
ze_event_pool_desc_t event_pool_desc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC,
nullptr,
ZE_EVENT_POOL_FLAG_HOST_VISIBLE, 1};
ze_event_pool_desc_t event_pool_desc = {
ZE_STRUCTURE_TYPE_EVENT_POOL_DESC, nullptr,
ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_IPC, 1};
ze_event_handle_t event = nullptr;
ze_event_desc_t event_desc = {ZE_STRUCTURE_TYPE_EVENT_DESC, nullptr};

Expand Down Expand Up @@ -1439,10 +1439,21 @@ TEST_F(

init_event_pool();

ze_result_t initial_result = zeEventPoolCloseIpcHandle(event_pool);
ze_ipc_event_pool_handle_t handle;
ze_event_pool_handle_t event_pool2;
ASSERT_EQ(ZE_RESULT_SUCCESS, zeEventPoolGetIpcHandle(event_pool, &ipc_event));
ASSERT_EQ(ZE_RESULT_SUCCESS,
zeEventPoolOpenIpcHandle(context, ipc_event, &event_pool2));

ze_result_t initial_result = zeEventPoolCloseIpcHandle(event_pool2);

ready_ltracer(tracer_handle, prologues, epilogues);

ASSERT_EQ(initial_result, zeEventPoolCloseIpcHandle(event_pool));
ASSERT_EQ(ZE_RESULT_SUCCESS, zeEventPoolGetIpcHandle(event_pool, &ipc_event));
ASSERT_EQ(ZE_RESULT_SUCCESS,
zeEventPoolOpenIpcHandle(context, ipc_event, &event_pool2));

ASSERT_EQ(initial_result, zeEventPoolCloseIpcHandle(event_pool2));
}

TEST_F(
Expand Down
Loading

0 comments on commit 683766e

Please sign in to comment.