mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 19:32:25 +08:00
Remove O(n) lookup in command container destructor
Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f4c40c74cb
commit
647321af6f
@@ -254,9 +254,8 @@ void CommandContainer::handleCmdBufferAllocations(size_t startIndex) {
|
|||||||
if (isHandleFenceCompletionRequired) {
|
if (isHandleFenceCompletionRequired) {
|
||||||
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
|
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
|
||||||
}
|
}
|
||||||
if (!this->reusableAllocationList->peekContains(*cmdBufferAllocations[i])) {
|
|
||||||
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
|
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]);
|
this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -879,20 +879,6 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithoutA
|
|||||||
allocList.freeAllGraphicsAllocations(pDevice);
|
allocList.freeAllGraphicsAllocations(pDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenDestroyCommandContainerThenAllocationListFilledCorrectly) {
|
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
|
||||||
AllocationsList allocList;
|
|
||||||
cmdContainer->initialize(pDevice, &allocList, false);
|
|
||||||
auto alloc = cmdContainer->getCmdBufferAllocations()[0];
|
|
||||||
allocList.pushFrontOne(*alloc);
|
|
||||||
cmdContainer.reset();
|
|
||||||
|
|
||||||
EXPECT_TRUE(allocList.peekContains(*alloc));
|
|
||||||
EXPECT_EQ(allocList.peekHead()->countThisAndAllConnected(), 1u);
|
|
||||||
|
|
||||||
allocList.freeAllGraphicsAllocations(pDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAllocationInListAndCsrTaskCountLowerThanAllocationThenReturnNullptr) {
|
HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAllocationInListAndCsrTaskCountLowerThanAllocationThenReturnNullptr) {
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||||
|
|||||||
Reference in New Issue
Block a user