Revert "fix: enable single temporary allocations list mode"
This reverts commit b496274d1a
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
parent
c98b95a43e
commit
42a8b63725
|
@ -92,7 +92,7 @@ MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : execu
|
|||
supportsMultiStorageResources = !!debugManager.flags.EnableMultiStorageResources.get();
|
||||
}
|
||||
|
||||
if (debugManager.flags.UseSingleListForTemporaryAllocations.get() != 0) {
|
||||
if (debugManager.flags.UseSingleListForTemporaryAllocations.get() == 1) {
|
||||
singleTemporaryAllocationsList = true;
|
||||
temporaryAllocations = std::make_unique<AllocationsList>(AllocationUsage::TEMPORARY_ALLOCATION);
|
||||
}
|
||||
|
@ -115,16 +115,14 @@ void MemoryManager::cleanTemporaryAllocations(const CommandStreamReceiver &csr,
|
|||
auto *nextAlloc = currentAlloc->next;
|
||||
bool freeAllocation = false;
|
||||
|
||||
if (currentAlloc->hostPtrTaskCountAssignment == 0) {
|
||||
if (currentAlloc->isUsedByOsContext(waitedOsContextId)) {
|
||||
if (currentAlloc->getTaskCount(waitedOsContextId) <= waitedTaskCount) {
|
||||
if (!currentAlloc->isUsedByManyOsContexts() || !allocInUse(*currentAlloc)) {
|
||||
freeAllocation = true;
|
||||
}
|
||||
if (currentAlloc->isUsedByOsContext(waitedOsContextId)) {
|
||||
if (currentAlloc->hostPtrTaskCountAssignment == 0 && 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) {
|
||||
|
|
|
@ -31,8 +31,15 @@ class MemoryAllocatorFixture : public MemoryManagementFixture {
|
|||
executionEnvironment->calculateMaxOsContextCount();
|
||||
|
||||
device.reset(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0u));
|
||||
memoryManager = static_cast<MockMemoryManager *>(device->getMemoryManager());
|
||||
memoryManager = new MockMemoryManager(false, false, *executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
csr = &device->getGpgpuCommandStreamReceiver();
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
auto engineType = gfxCoreHelper.getGpgpuEngineInstances(device->getRootDeviceEnvironment())[0].first;
|
||||
auto osContext = memoryManager->createAndRegisterOsContext(csr, EngineDescriptorHelper::getDefaultDescriptor({engineType, EngineUsage::regular},
|
||||
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo)));
|
||||
csr->setupContext(*osContext);
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
|
|
|
@ -1129,18 +1129,18 @@ HWTEST_F(HostPtrAllocationTest, givenSingleTempAllocationsListWhenAddingToStorag
|
|||
TEST_F(HostPtrAllocationTest, givenDebugFlagSetWhenCreatingMemoryManagerThenEnableSingleTempAllocationsList) {
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
|
||||
{
|
||||
auto memoryManager = std::make_unique<MockMemoryManager>(executionEnvironment);
|
||||
EXPECT_TRUE(memoryManager->isSingleTemporaryAllocationsListEnabled());
|
||||
EXPECT_NE(nullptr, memoryManager->temporaryAllocations.get());
|
||||
}
|
||||
|
||||
debugManager.flags.UseSingleListForTemporaryAllocations.set(0);
|
||||
{
|
||||
auto memoryManager = std::make_unique<MockMemoryManager>(executionEnvironment);
|
||||
EXPECT_FALSE(memoryManager->isSingleTemporaryAllocationsListEnabled());
|
||||
EXPECT_EQ(nullptr, memoryManager->temporaryAllocations.get());
|
||||
}
|
||||
|
||||
debugManager.flags.UseSingleListForTemporaryAllocations.set(1);
|
||||
{
|
||||
auto memoryManager = std::make_unique<MockMemoryManager>(executionEnvironment);
|
||||
EXPECT_TRUE(memoryManager->isSingleTemporaryAllocationsListEnabled());
|
||||
EXPECT_NE(nullptr, memoryManager->temporaryAllocations.get());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(HostPtrAllocationTest, whenOverlappedFragmentIsBiggerThenStoredAndStoredFragmentCannotBeDestroyedThenCheckForOverlappingReturnsError) {
|
||||
|
|
|
@ -179,7 +179,6 @@ TEST_F(TagAllocatorTest, WhenGettingAndReturningTagThenFreeAndUsedListsAreUpdate
|
|||
TEST_F(TagAllocatorTest, WhenTagAllocatorIsCreatedThenItPopulatesTagsWithProperDeviceBitfield) {
|
||||
size_t alignment = 64;
|
||||
|
||||
memoryManager->recentlyPassedDeviceBitfield = 0;
|
||||
EXPECT_NE(deviceBitfield, memoryManager->recentlyPassedDeviceBitfield);
|
||||
MockTagAllocator<TimeStamps> tagAllocator(memoryManager, 10, alignment, deviceBitfield);
|
||||
EXPECT_EQ(deviceBitfield, memoryManager->recentlyPassedDeviceBitfield);
|
||||
|
|
Loading…
Reference in New Issue