From bc68b70b40d2b90a6ee499cf8393979dccafde63 Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Mon, 10 Mar 2025 18:05:48 +0000 Subject: [PATCH] fix: perform full host synchronization upon immediate cmdlist destruction Related-To: NEO-10356 Signed-off-by: Zbigniew Zdanowicz --- .../source/cmdlist/cmdlist_hw_immediate.inl | 16 ++++++----- .../core/source/cmdlist/cmdlist_imp.cpp | 3 +-- .../fixtures/in_order_cmd_list_fixture.h | 13 +++++++++ .../sources/cmdlist/test_cmdlist_1.cpp | 25 +++++++++++++++++ .../sources/cmdlist/test_cmdlist_2.cpp | 6 ++++- .../sources/cmdlist/test_cmdlist_4.cpp | 20 ++++++++++++++ .../cmdlist/test_in_order_cmdlist_1.cpp | 27 +++++++++++++++++++ .../cmdlist/test_in_order_cmdlist_2.cpp | 8 ++++-- .../cmdlist/test_in_order_cmdlist_3.cpp | 7 ++++- 9 files changed, 112 insertions(+), 13 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl index 3b2ee4401e..448e9126fa 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl @@ -1651,15 +1651,17 @@ ze_result_t CommandListCoreFamilyImmediate::synchronizeInOrderExe bool signaled = true; - const uint64_t *hostAddress = ptrOffset(inOrderExecInfo->getBaseHostAddress(), inOrderExecInfo->getAllocationOffset()); + if (csr->getType() != NEO::CommandStreamReceiverType::aub) { + const uint64_t *hostAddress = ptrOffset(inOrderExecInfo->getBaseHostAddress(), inOrderExecInfo->getAllocationOffset()); - for (uint32_t i = 0; i < inOrderExecInfo->getNumHostPartitionsToWait(); i++) { - if (!NEO::WaitUtils::waitFunctionWithPredicate(hostAddress, waitValue, std::greater_equal())) { - signaled = false; - break; + for (uint32_t i = 0; i < inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + if (!NEO::WaitUtils::waitFunctionWithPredicate(hostAddress, waitValue, std::greater_equal())) { + signaled = false; + break; + } + + hostAddress = ptrOffset(hostAddress, this->device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); } - - hostAddress = ptrOffset(hostAddress, this->device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); } if (signaled) { diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index fbb532ae08..97920e2cf4 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -50,8 +50,7 @@ ze_result_t CommandListImp::destroy() { } if (isImmediateType() && this->isFlushTaskSubmissionEnabled && !this->isSyncModeQueue) { - auto timeoutMicroseconds = NEO::TimeoutControls::maxTimeout; - getCsr(false)->waitForCompletionWithTimeout(NEO::WaitParams{false, false, false, timeoutMicroseconds}, getCsr(false)->peekTaskCount()); + this->hostSynchronize(std::numeric_limits::max()); } if (!isImmediateType() && diff --git a/level_zero/core/test/unit_tests/fixtures/in_order_cmd_list_fixture.h b/level_zero/core/test/unit_tests/fixtures/in_order_cmd_list_fixture.h index f5935b79b1..d8e9a98d26 100644 --- a/level_zero/core/test/unit_tests/fixtures/in_order_cmd_list_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/in_order_cmd_list_fixture.h @@ -13,6 +13,7 @@ #include "shared/test/common/test_macros/hw_test.h" #include "level_zero/core/source/event/event_imp.h" +#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h" #include "level_zero/core/test/unit_tests/fixtures/module_fixture.h" #include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h" #include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h" @@ -196,11 +197,23 @@ struct InOrderCmdListFixture : public ::Test { cmdList->copyOperationFenceSupported = device->getProductHelper().isDeviceToHostCopySignalingFenceRequired(); } + completeHostAddress(cmdList.get()); + createdCmdLists++; return cmdList; } + template + void completeHostAddress(CmdListT *cmdList) { + uint64_t maxValue = std::numeric_limits::max(); + void *hostAddress = ptrOffset(cmdList->inOrderExecInfo->getBaseHostAddress(), cmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < cmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + memcpy(hostAddress, &maxValue, sizeof(maxValue)); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } + } + template DestroyableZeUniquePtr>> createRegularCmdList(bool copyOnly) { auto cmdList = makeZeUniquePtr>>(); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp index 88ede4e4d0..7de69a6067 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp @@ -1314,6 +1314,11 @@ HWTEST2_F(CommandListCreateTests, givenDirectSubmissionAndImmCmdListWhenDispatch for (bool inOrderExecution : {false, true}) { if (inOrderExecution && !inOrderExecAlreadyEnabled) { whiteBoxCmdList->enableInOrderExecution(); + uint64_t *hostAddress = ptrOffset(whiteBoxCmdList->inOrderExecInfo->getBaseHostAddress(), whiteBoxCmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < whiteBoxCmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } inOrderExecAlreadyEnabled = true; } @@ -1670,6 +1675,11 @@ HWTEST2_F(CommandListCreateTests, givenInOrderExecutionWhenDispatchingRelaxedOrd ASSERT_NE(nullptr, commandList); auto whiteBoxCmdList = static_cast(commandList.get()); whiteBoxCmdList->enableInOrderExecution(); + uint64_t *hostAddress = ptrOffset(whiteBoxCmdList->inOrderExecInfo->getBaseHostAddress(), whiteBoxCmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < whiteBoxCmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } ze_event_pool_desc_t eventPoolDesc = {}; eventPoolDesc.count = 1; @@ -1726,6 +1736,11 @@ HWTEST2_F(CommandListCreateTests, givenInOrderExecutionWhenDispatchingBarrierThe ASSERT_NE(nullptr, commandList); auto whiteBoxCmdList = static_cast(commandList.get()); whiteBoxCmdList->enableInOrderExecution(); + uint64_t *hostAddress = ptrOffset(whiteBoxCmdList->inOrderExecInfo->getBaseHostAddress(), whiteBoxCmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < whiteBoxCmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } ze_event_pool_desc_t eventPoolDesc = {}; eventPoolDesc.count = 1; @@ -1798,6 +1813,11 @@ HWTEST2_F(CommandListCreateTests, givenInOrderExecutionWhenDispatchingBarrierWit auto whiteBoxCmdList0 = static_cast(commandList0.get()); auto whiteBoxCmdList = static_cast(commandList.get()); whiteBoxCmdList->enableInOrderExecution(); + uint64_t *hostAddress = ptrOffset(whiteBoxCmdList->inOrderExecInfo->getBaseHostAddress(), whiteBoxCmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < whiteBoxCmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } ze_event_pool_desc_t eventPoolDesc = {}; eventPoolDesc.count = 1; @@ -1874,6 +1894,11 @@ HWTEST2_F(CommandListCreateTests, givenInOrderExecutionWhenDispatchingRelaxedOrd cmdList.reset(CommandList::whiteboxCast(CommandList::createImmediate(productFamily, device, &desc, false, engineGroupType, returnValue))); cmdList->isFlushTaskSubmissionEnabled = true; cmdList->enableInOrderExecution(); + uint64_t *hostAddress = ptrOffset(cmdList->inOrderExecInfo->getBaseHostAddress(), cmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < cmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } std::unique_ptr mockModule = std::make_unique(device, nullptr, ModuleType::builtin); Mock<::L0::KernelImp> kernel; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index 022d8bf4f8..856e1a318d 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -1903,7 +1903,11 @@ HWTEST2_F(PrimaryBatchBufferCmdListTest, givenRelaxedOrderingAndRegularCmdListAn ASSERT_NE(nullptr, immCommandList); auto whiteBoxCmdList = static_cast(immCommandList.get()); whiteBoxCmdList->enableInOrderExecution(); - + uint64_t *hostAddress = ptrOffset(whiteBoxCmdList->inOrderExecInfo->getBaseHostAddress(), whiteBoxCmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < whiteBoxCmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } auto ultCsr = static_cast *>(whiteBoxCmdList->getCsr(false)); ultCsr->recordFlushedBatchBuffer = true; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp index d04028b728..fab871df96 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp @@ -1757,5 +1757,25 @@ HWTEST2_F(ImmediateCommandListTest, EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_FIRST_LEVEL_BATCH, bbStart->getSecondLevelBatchBuffer()); } +HWTEST2_F(ImmediateCommandListTest, givenAsyncCmdlistWhenCmdlistIsDestroyedThenHostSynchronizeCalled, MatchAny) { + ze_command_queue_desc_t queueDesc{ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; + queueDesc.ordinal = 0u; + queueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; + + ze_result_t returnValue; + auto immediateCmdList = CommandList::whiteboxCast(CommandList::createImmediate(productFamily, device, &queueDesc, false, engineGroupType, returnValue)); + + immediateCmdList->cmdQImmediate->registerCsrClient(); + auto csr = immediateCmdList->getCsr(false); + + auto clientCount = csr->getNumClients(); + EXPECT_EQ(1u, clientCount); + + immediateCmdList->destroy(); + + clientCount = csr->getNumClients(); + EXPECT_EQ(0u, clientCount); +} + } // namespace ult } // namespace L0 diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp index b8d422f766..b6938122a5 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp @@ -308,6 +308,9 @@ HWTEST2_F(InOrderCmdListTests, givenCmdListsWhenDispatchingThenUseInternalTaskCo context->freeMem(deviceAlloc); } + + completeHostAddress>>(immCmdList0.get()); + completeHostAddress>>(immCmdList1.get()); } HWTEST2_F(InOrderCmdListTests, givenCounterBasedEventsWhenHostWaitsAreCalledThenLatestWaitIsRecorded, MatchAny) { @@ -343,6 +346,8 @@ HWTEST2_F(InOrderCmdListTests, givenCounterBasedEventsWhenHostWaitsAreCalledThen inOrderExecInfo->setAllocationOffset(4u); EXPECT_FALSE(inOrderExecInfo->isCounterAlreadyDone(0u)); EXPECT_FALSE(inOrderExecInfo->isCounterAlreadyDone(counterValue)); + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenEventHostSyncCalledThenCallWaitUserFence, IsAtLeastXeHpCore) { @@ -975,6 +980,8 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenSubmittingThenProgramSemaphor } ASSERT_TRUE(verifyInOrderDependency(itor, 1, immCmdList->inOrderExecInfo->getBaseDeviceAddress() + counterOffset, immCmdList->isQwordInOrderCounter(), false)); + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenResolveDependenciesViaPipeControlsForInOrderModeWhenSubmittingThenProgramPipeControlInBetweenDispatches, IsAtLeastXeHpCore) { @@ -1002,6 +1009,8 @@ HWTEST2_F(InOrderCmdListTests, givenResolveDependenciesViaPipeControlsForInOrder auto itor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), itor); + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenOptimizedCbEventWhenSubmittingThenProgramPipeControlOrSemaphoreInBetweenDispatches, IsAtLeastXeHpCore) { @@ -1035,6 +1044,8 @@ HWTEST2_F(InOrderCmdListTests, givenOptimizedCbEventWhenSubmittingThenProgramPip auto itor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), itor); } + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenInOrderCmdListWhenSubmittingThenProgramPipeControlOrSemaphoreInBetweenDispatches, IsAtLeastXeHpCore) { @@ -1068,6 +1079,8 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderCmdListWhenSubmittingThenProgramPipeC auto itor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), itor); } + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenDependencyFromDifferentRootDeviceWhenAppendCalledThenCreatePeerAllocation, MatchAny) { @@ -1107,6 +1120,11 @@ HWTEST2_F(InOrderCmdListTests, givenDependencyFromDifferentRootDeviceWhenAppendC cmdList->initialize(inputDevice, NEO::EngineGroupType::renderCompute, 0u); cmdList->commandContainer.setImmediateCmdListCsr(csr); cmdList->enableInOrderExecution(); + uint64_t *hostAddress = ptrOffset(cmdList->inOrderExecInfo->getBaseHostAddress(), cmdList->inOrderExecInfo->getAllocationOffset()); + for (uint32_t i = 0; i < cmdList->inOrderExecInfo->getNumHostPartitionsToWait(); i++) { + *hostAddress = std::numeric_limits::max(); + hostAddress = ptrOffset(hostAddress, device->getL0GfxCoreHelper().getImmediateWritePostSyncOffset()); + } createdCmdLists++; @@ -1418,6 +1436,9 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderEventModeWhenSubmittingThenProgramSem itor = find(itor, cmdList.end()); EXPECT_EQ(cmdList.end(), itor); + + completeHostAddress>>(immCmdList.get()); + completeHostAddress>>(immCmdList2.get()); } HWTEST2_F(InOrderCmdListTests, givenImplicitEventConvertionEnabledWhenUsingImmediateCmdListThenConvertEventToCounterBased, MatchAny) { @@ -4403,6 +4424,8 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenProgrammingCounterWithOverflo useZeroOffset = !useZeroOffset; } + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenProgrammingCounterWithOverflowThenHandleItCorrectly, IsAtLeastXeHpCore) { @@ -4503,6 +4526,8 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenProgrammingCounterWithOverflo EXPECT_EQ(expectedCounter, events[0]->inOrderExecSignalValue); EXPECT_EQ(offset, events[0]->inOrderAllocationOffset); + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(InOrderCmdListTests, givenCopyOnlyInOrderModeWhenProgrammingBarrierThenSignalInOrderAllocation, IsAtLeastXeHpCore) { @@ -5978,6 +6003,8 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenGpuHangDetectedInCpuCopyPathT ultCsr->forceReturnGpuHang = false; + *hostAddress = std::numeric_limits::max(); + context->freeMem(deviceAlloc); } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp index 37973897e8..d30162f013 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp @@ -763,6 +763,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenInOrderModeWhenCallingSyncThenHandleComp EXPECT_EQ(0u, mainQueueCsr->waitForCompletionWithTimeoutTaskCountCalled.load()); EXPECT_EQ(0u, offloadCsr->waitForCompletionWithTimeoutTaskCountCalled.load()); } + *hostAddress = std::numeric_limits::max(); } HWTEST2_F(CopyOffloadInOrderTests, givenTbxModeWhenSyncCalledAlwaysDownloadAllocationsFromBothCsrs, IsAtLeastXeHpCore) { @@ -844,6 +845,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenNonInOrderModeWaitWhenCallingSyncThenHan immCmdList->hostSynchronize(0, true); EXPECT_EQ(1u, mainQueueCsr->waitForCompletionWithTimeoutTaskCountCalled.load()); EXPECT_EQ(1u, offloadCsr->waitForCompletionWithTimeoutTaskCountCalled.load()); + *hostAddress = std::numeric_limits::max(); } HWTEST2_F(CopyOffloadInOrderTests, givenNonInOrderModeWaitWhenCallingSyncThenHandleCompletionAndTempAllocations, IsAtLeastXeHpCore) { @@ -918,6 +920,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenNonInOrderModeWaitWhenCallingSyncThenHan immCmdList->hostSynchronize(0, true); EXPECT_TRUE(mainInternalStorage->getTemporaryAllocations().peekIsEmpty()); EXPECT_TRUE(offloadInternalStorage->getTemporaryAllocations().peekIsEmpty()); + *hostAddress = std::numeric_limits::max(); } HWTEST2_F(CopyOffloadInOrderTests, givenInterruptEventWhenDispatchingTheProgramUserInterrupt, IsAtLeastXeHpcCore) { @@ -1970,8 +1973,7 @@ HWTEST2_F(StandaloneInOrderTimestampAllocationTests, givenTimestampEventWhenDisp cmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false); - // mark as not ready, to make sure that destructor will release everything anyway - *hostAddress = 0; + *hostAddress = std::numeric_limits::max(); } using SynchronizedDispatchTests = InOrderCmdListFixture; @@ -3205,6 +3207,8 @@ HWTEST2_F(MultiTileInOrderCmdListTests, givenMultiTileInOrderModeWhenCallingSync *hostAddress1 = 3; EXPECT_EQ(ZE_RESULT_SUCCESS, immCmdList->hostSynchronize(0, false)); EXPECT_EQ(ZE_RESULT_SUCCESS, events[0]->hostSynchronize(0)); + + completeHostAddress>>(immCmdList.get()); } HWTEST2_F(MultiTileInOrderCmdListTests, whenUsingRegularCmdListThenAddWalkerToPatch, IsAtLeastXeHpCore) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_3.cpp index 9015006eaf..d936c3b010 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_3.cpp @@ -131,7 +131,7 @@ HWTEST2_F(InOrderIpcTests, givenCounterOffsetWhenOpenIsCalledThenPassCorrectData static_cast(events[0]->inOrderExecInfo.get())->numDevicePartitionsToWait = 2; static_cast(events[0]->inOrderExecInfo.get())->numHostPartitionsToWait = 3; - + static_cast(events[0]->inOrderExecInfo.get())->initializeAllocationsFromHost(); auto deviceAlloc = static_cast(events[0]->inOrderExecInfo->getDeviceCounterAllocation()); auto hostAlloc = static_cast(events[0]->inOrderExecInfo->getHostCounterAllocation()); @@ -155,6 +155,8 @@ HWTEST2_F(InOrderIpcTests, givenCounterOffsetWhenOpenIsCalledThenPassCorrectData EXPECT_TRUE(expectedOffset == ipcData.counterOffset); EXPECT_TRUE(events[0]->inOrderExecInfo->getNumDevicePartitionsToWait() == ipcData.devicePartitions); EXPECT_TRUE(events[0]->inOrderExecInfo->isHostStorageDuplicated() ? events[0]->inOrderExecInfo->getNumHostPartitionsToWait() : events[0]->inOrderExecInfo->getNumDevicePartitionsToWait() == ipcData.hostPartitions); + + completeHostAddress>>(immCmdList2.get()); } HWTEST2_F(InOrderIpcTests, givenIpcHandleWhenCreatingNewEventThenSetCorrectData, MatchAny) { @@ -169,6 +171,7 @@ HWTEST2_F(InOrderIpcTests, givenIpcHandleWhenCreatingNewEventThenSetCorrectData, auto event0InOrderInfo = static_cast(events[0]->inOrderExecInfo.get()); event0InOrderInfo->numDevicePartitionsToWait = 2; event0InOrderInfo->numHostPartitionsToWait = 3; + event0InOrderInfo->initializeAllocationsFromHost(); zex_ipc_counter_based_event_handle_t zexIpcData = {}; @@ -208,6 +211,8 @@ HWTEST2_F(InOrderIpcTests, givenIpcHandleWhenCreatingNewEventThenSetCorrectData, EXPECT_EQ(expectedOffset, newEventMock->inOrderAllocationOffset); zexCounterBasedEventCloseIpcHandle(newEvent); + + completeHostAddress>>(immCmdList2.get()); } HWTEST2_F(InOrderIpcTests, givenInvalidInternalHandleWhenOpenCalledThenReturnError, MatchAny) {