mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
fix: remove heap resource leak after command list reset
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0edb025cf7
commit
db9d0c9a58
@@ -130,11 +130,8 @@ void CommandList::removeDeallocationContainerData() {
|
||||
if (allocData) {
|
||||
device->getDriverHandle()->getSvmAllocsManager()->removeSVMAlloc(*allocData);
|
||||
}
|
||||
if (!((deallocation->getAllocationType() == NEO::AllocationType::internalHeap) ||
|
||||
(deallocation->getAllocationType() == NEO::AllocationType::linearStream))) {
|
||||
memoryManager->freeGraphicsMemory(deallocation);
|
||||
eraseDeallocationContainerEntry(deallocation);
|
||||
}
|
||||
memoryManager->freeGraphicsMemory(deallocation);
|
||||
eraseDeallocationContainerEntry(deallocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1923,23 +1923,6 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceFo
|
||||
EXPECT_EQ(latestFlushedTaskCount + 1, whiteBoxCmdList->csr->peekLatestFlushedTaskCount());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandListCreate, givenCommandListWhenRemoveDeallocationContainerDataThenHeapNotErased) {
|
||||
ze_result_t returnValue;
|
||||
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily,
|
||||
device,
|
||||
NEO::EngineGroupType::compute,
|
||||
0u,
|
||||
returnValue, false));
|
||||
auto &cmdContainer = commandList->getCmdContainer();
|
||||
auto heapAlloc = cmdContainer.getIndirectHeapAllocation(HeapType::indirectObject);
|
||||
cmdContainer.getDeallocationContainer().push_back(heapAlloc);
|
||||
EXPECT_EQ(cmdContainer.getDeallocationContainer().size(), 1u);
|
||||
commandList->removeDeallocationContainerData();
|
||||
EXPECT_EQ(cmdContainer.getDeallocationContainer().size(), 1u);
|
||||
|
||||
cmdContainer.getDeallocationContainer().clear();
|
||||
}
|
||||
|
||||
TEST(CommandList, givenContextGroupEnabledWhenCreatingImmediateCommandListThenEachCmdListHasDifferentCsr) {
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
Reference in New Issue
Block a user