From 6550dca069c113d3d43a56dcfd9f0d7e5c71e552 Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Tue, 28 Jun 2022 14:41:31 +0000 Subject: [PATCH] extend command list unit test Signed-off-by: Zbigniew Zdanowicz --- .../test_cmdlist_append_launch_kernel_3.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp index 2ec488ff76..d365e9dca9 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp @@ -745,14 +745,21 @@ HWTEST2_F(MultiTileImmediateCommandListAppendLaunchFunctionXeHpCoreTest, givenIm auto result = immediateCmdList->initialize(device, NEO::EngineGroupType::Compute, 0u); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto cmdStream = immediateCmdList->commandContainer.getCommandStream(); - - auto sizeBefore = cmdStream->getUsed(); CmdListKernelLaunchParams launchParams = {}; result = immediateCmdList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); ASSERT_EQ(ZE_RESULT_SUCCESS, result); + + auto cmdStream = immediateCmdList->commandContainer.getCommandStream(); + + auto sizeBefore = cmdStream->getUsed(); + result = immediateCmdList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); + ASSERT_EQ(ZE_RESULT_SUCCESS, result); auto sizeAfter = cmdStream->getUsed(); + uint64_t bbStartGpuAddress = cmdStream->getGraphicsAllocation()->getGpuAddress() + sizeBefore; + bbStartGpuAddress += sizeof(WALKER_TYPE) + sizeof(PIPE_CONTROL) + sizeof(MI_ATOMIC) + sizeof(MI_SEMAPHORE_WAIT) + + sizeof(MI_BATCH_BUFFER_START) + 3 * sizeof(uint32_t); + GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( cmdList, @@ -771,6 +778,8 @@ HWTEST2_F(MultiTileImmediateCommandListAppendLaunchFunctionXeHpCoreTest, givenIm EXPECT_EQ(itorPipeControl, itorStoreDataImm); auto itorBbStart = find(itorPipeControl, cmdList.end()); + auto cmdBbStart = genCmdCast(*itorBbStart); + EXPECT_EQ(bbStartGpuAddress, cmdBbStart->getBatchBufferStartAddress()); ASSERT_NE(cmdList.end(), itorBbStart); auto itorMiAtomic = find(itorBbStart, cmdList.end());