Skip to content

Commit

Permalink
Add CTS to verify calls to zet/zes api with tracing layer enabled (#55)
Browse files Browse the repository at this point in the history
Signed-off-by: Neil R. Spruit <[email protected]>
  • Loading branch information
nrspruit authored Jul 17, 2024
1 parent 3524f6a commit 50a37fa
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions layer_tests/tracing/src/test_api_ltracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,42 @@ TEST_F(
ASSERT_EQ(initial_result, zeCommandListReset(command_list));
}

TEST_F(
LTRACING_TEST_NAME,
GivenWhenTracerEnabledWithCalltoZetAPIThenSuccessIsReturnedFromZetAPI) {
prologues.CommandList.pfnResetCb = lzt::lprologue_callback;
epilogues.CommandList.pfnResetCb = lzt::lepilogue_callback;

init_command_list();

ze_result_t initial_result = zeCommandListReset(command_list);
ready_ltracer(tracer_handle, prologues, epilogues);

ASSERT_EQ(initial_result, zeCommandListReset(command_list));
uint32_t metricGroupCount = 0;
EXPECT_EQ(ZE_RESULT_SUCCESS,
zetMetricGroupGet(device, &metricGroupCount, nullptr));
}

TEST_F(
LTRACING_TEST_NAME,
GivenWhenTracerEnabledWithCalltoZesAPIThenSuccessIsReturnedFromZesAPI) {
prologues.CommandList.pfnResetCb = lzt::lprologue_callback;
epilogues.CommandList.pfnResetCb = lzt::lepilogue_callback;

init_command_list();

ze_result_t initial_result = zeCommandListReset(command_list);
ready_ltracer(tracer_handle, prologues, epilogues);

ASSERT_EQ(initial_result, zeCommandListReset(command_list));
EXPECT_EQ(ZE_RESULT_SUCCESS,
zesInit(0));
uint32_t zesCount = 0;
EXPECT_EQ(ZE_RESULT_SUCCESS,
zesDriverGet(&zesCount, nullptr));
}

TEST_F(
LTRACING_TEST_NAME,
GivenEnabledTracerWithzeCommandListCloseCallbacksWhenCallingzeCommandListCloseThenUserDataIsSetAndResultUnchanged) {
Expand Down

0 comments on commit 50a37fa

Please sign in to comment.