mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
refactor: use single vector to store used heap allocations
Related-To: NEO-10483 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
dab5469f81
commit
f496233462
@@ -39,8 +39,10 @@ CommandContainer::~CommandContainer() {
|
||||
for (auto allocationIndirectHeap : allocationIndirectHeaps) {
|
||||
heapHelper->storeHeapAllocation(allocationIndirectHeap);
|
||||
}
|
||||
for (auto heapAllocation : storedHeapsContainer) {
|
||||
heapHelper->storeHeapAllocation(heapAllocation);
|
||||
for (auto deallocation : deallocationContainer) {
|
||||
if ((deallocation->getAllocationType() == AllocationType::internalHeap) || (deallocation->getAllocationType() == AllocationType::linearStream)) {
|
||||
getHeapHelper()->storeHeapAllocation(deallocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,11 +186,12 @@ void CommandContainer::reset() {
|
||||
slmSize = std::numeric_limits<uint32_t>::max();
|
||||
getResidencyContainer().clear();
|
||||
if (getHeapHelper()) {
|
||||
for (auto heapAllocation : storedHeapsContainer) {
|
||||
getHeapHelper()->storeHeapAllocation(heapAllocation);
|
||||
for (auto deallocation : deallocationContainer) {
|
||||
if ((deallocation->getAllocationType() == AllocationType::internalHeap) || (deallocation->getAllocationType() == AllocationType::linearStream)) {
|
||||
getHeapHelper()->storeHeapAllocation(deallocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
storedHeapsContainer.clear();
|
||||
getDeallocationContainer().clear();
|
||||
sshAllocations.clear();
|
||||
|
||||
@@ -285,7 +288,7 @@ void CommandContainer::createAndAssignNewHeap(HeapType heapType, size_t size) {
|
||||
if (this->immediateCmdListCsr) {
|
||||
this->storeAllocationAndFlushTagUpdate(oldAlloc);
|
||||
} else {
|
||||
storedHeapsContainer.push_back(oldAlloc);
|
||||
getDeallocationContainer().push_back(oldAlloc);
|
||||
}
|
||||
setIndirectHeapAllocation(heapType, newAlloc);
|
||||
if (oldBase != newBase) {
|
||||
|
||||
Reference in New Issue
Block a user