Fill reusable allocation list for secondary command buffer

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-02-24 08:47:31 +00:00
committed by Compute-Runtime-Automation
parent 5af9509877
commit 9a7d2f8068
2 changed files with 29 additions and 0 deletions

View File

@@ -1394,6 +1394,29 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsThe
allocList.freeAllGraphicsAllocations(pDevice);
}
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenFillReusableAllocationListsThenCreateAlocsForSecondaryCmdBuffer) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.SetAmountOfReusableAllocations.set(1);
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
AllocationsList allocList;
cmdContainer->initialize(pDevice, &allocList, true, true);
cmdContainer->setImmediateCmdListCsr(csr);
auto actualResidencyContainerSize = cmdContainer->getResidencyContainer().size();
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
cmdContainer->fillReusableAllocationLists();
ASSERT_NE(cmdContainer->immediateReusableAllocationList, nullptr);
EXPECT_FALSE(cmdContainer->immediateReusableAllocationList->peekIsEmpty());
EXPECT_EQ(cmdContainer->getResidencyContainer().size(), actualResidencyContainerSize + 2);
cmdContainer.reset();
allocList.freeAllGraphicsAllocations(pDevice);
}
TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWithSharedHeapsEnabledThenOnlyOneHeapFilled) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.SetAmountOfReusableAllocations.set(1);