fix: enable single temporary allocations list mode

Related-To: NEO-14641

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2025-05-21 17:06:09 +00:00
committed by Compute-Runtime-Automation
parent a2c41e4749
commit b496274d1a
4 changed files with 18 additions and 22 deletions

View File

@@ -92,7 +92,7 @@ MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : execu
supportsMultiStorageResources = !!debugManager.flags.EnableMultiStorageResources.get();
}
if (debugManager.flags.UseSingleListForTemporaryAllocations.get() == 1) {
if (debugManager.flags.UseSingleListForTemporaryAllocations.get() != 0) {
singleTemporaryAllocationsList = true;
temporaryAllocations = std::make_unique<AllocationsList>(AllocationUsage::TEMPORARY_ALLOCATION);
}
@@ -115,14 +115,16 @@ void MemoryManager::cleanTemporaryAllocations(const CommandStreamReceiver &csr,
auto *nextAlloc = currentAlloc->next;
bool freeAllocation = false;
if (currentAlloc->isUsedByOsContext(waitedOsContextId)) {
if (currentAlloc->hostPtrTaskCountAssignment == 0 && currentAlloc->getTaskCount(waitedOsContextId) <= waitedTaskCount) {
if (!currentAlloc->isUsedByManyOsContexts() || !allocInUse(*currentAlloc)) {
freeAllocation = true;
if (currentAlloc->hostPtrTaskCountAssignment == 0) {
if (currentAlloc->isUsedByOsContext(waitedOsContextId)) {
if (currentAlloc->getTaskCount(waitedOsContextId) <= waitedTaskCount) {
if (!currentAlloc->isUsedByManyOsContexts() || !allocInUse(*currentAlloc)) {
freeAllocation = true;
}
}
} else if (!allocInUse(*currentAlloc)) {
freeAllocation = true;
}
} else if (!allocInUse(*currentAlloc)) {
freeAllocation = true;
}
if (freeAllocation) {