Skip to content

Commit d6f60a2

Browse files
authored
Add ipc event query status sub case (#138)
1 parent cc5f9f4 commit d6f60a2

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

conformance_tests/core/test_ipc/src/test_ipc_event.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,17 @@ static void run_ipc_event_test(parent_test_t parent_test,
270270
run_workload(hEvent, context, startTime, endTime,
271271
(timestamp_type == MAPPED_KERNEL_TIMESTAMP));
272272
break;
273+
case PARENT_TEST_QUERY_EVENT_STATUS:
274+
break;
273275
default:
274276
FAIL() << "Fatal test error";
275277
}
276278

277279
c.wait(); // wait for the process to exit
278280
ASSERT_EQ(c.exit_code(), 0);
279-
281+
if (parent_test == PARENT_TEST_QUERY_EVENT_STATUS) {
282+
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventQueryStatus(hEvent));
283+
}
280284
if (parent_test == PARENT_TEST_HOST_LAUNCHES_KERNEL) {
281285
// ensure the timestamps match
282286
std::memcpy(&test_data, region.get_address(), sizeof(shared_data_t));
@@ -362,6 +366,12 @@ TEST(
362366
CHILD_TEST_HOST_MAPPED_TIMESTAMP_READS, false, false);
363367
}
364368

369+
TEST(zeIPCEventTests,
370+
GivenTwoProcessesWhenEventSignaledByChildThenEventQueryStatusSuccess) {
371+
run_ipc_event_test(PARENT_TEST_QUERY_EVENT_STATUS,
372+
CHILD_TEST_QUERY_EVENT_STATUS, false, false);
373+
}
374+
365375
TEST(
366376
zeIPCEventMultipleDeviceTests,
367377
GivenTwoProcessesWhenEventSignaledByDeviceInParentThenEventSetinChildFromSecondDevicePerspective) {

conformance_tests/core/test_ipc/src/test_ipc_event.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
typedef enum {
1313
PARENT_TEST_HOST_SIGNALS,
1414
PARENT_TEST_DEVICE_SIGNALS,
15-
PARENT_TEST_HOST_LAUNCHES_KERNEL
15+
PARENT_TEST_HOST_LAUNCHES_KERNEL,
16+
PARENT_TEST_QUERY_EVENT_STATUS
1617
} parent_test_t;
1718

1819
typedef enum {
@@ -22,7 +23,8 @@ typedef enum {
2223
CHILD_TEST_MULTI_DEVICE_READS,
2324
CHILD_TEST_HOST_TIMESTAMP_READS,
2425
CHILD_TEST_DEVICE_TIMESTAMP_READS,
25-
CHILD_TEST_HOST_MAPPED_TIMESTAMP_READS
26+
CHILD_TEST_HOST_MAPPED_TIMESTAMP_READS,
27+
CHILD_TEST_QUERY_EVENT_STATUS
2628
} child_test_t;
2729

2830
typedef struct {

conformance_tests/core/test_ipc/src/test_ipc_event_helper.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ static void child_host_reads(ze_event_pool_handle_t hEventPool) {
4242
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventDestroy(hEvent));
4343
}
4444

45+
static void child_query_event_status(ze_event_pool_handle_t hEventPool) {
46+
ze_event_handle_t hEvent = nullptr;
47+
EXPECT_EQ(ZE_RESULT_SUCCESS,
48+
zeEventCreate(hEventPool, &defaultEventDesc, &hEvent));
49+
EXPECT_EQ(ZE_RESULT_NOT_READY, zeEventQueryStatus(hEvent));
50+
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(hEvent));
51+
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventQueryStatus(hEvent));
52+
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventDestroy(hEvent));
53+
}
54+
4555
static void child_device_reads(ze_event_pool_handle_t hEventPool,
4656
bool device_events, ze_context_handle_t context,
4757
bool isImmediate) {
@@ -318,6 +328,9 @@ int main() {
318328
child_host_query_timestamp(hEventPool, shared_data, true);
319329
std::memcpy(region.get_address(), &shared_data, sizeof(shared_data_t));
320330
break;
331+
case CHILD_TEST_QUERY_EVENT_STATUS:
332+
child_query_event_status(hEventPool);
333+
break;
321334
default:
322335
LOG_DEBUG << "Unrecognized test case";
323336
lzt::destroy_context(context);

0 commit comments

Comments
 (0)