mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Improve private memory allocation.
-allocate from single bank when only one sub device passed Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d71c68ef0a
commit
bf1180753d
@@ -108,22 +108,24 @@ TEST_F(MultiDeviceStorageInfoTest, givenDisabledFlagForMultiTileIsaPlacementWhen
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceThenAllMemoryBanksAreOnAndPageTableClonningIsNotRequired) {
|
||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceWithOneTileThenOnlySingleBankIsUsed) {
|
||||
AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::PRIVATE_SURFACE, false, false, singleTileMask};
|
||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||
EXPECT_FALSE(storageInfo.cloningOfPageTables);
|
||||
EXPECT_EQ(singleTileMask, storageInfo.memoryBanks);
|
||||
EXPECT_EQ(singleTileMask, storageInfo.pageTablesVisibility);
|
||||
EXPECT_FALSE(storageInfo.tileInstanced);
|
||||
EXPECT_EQ(1u, storageInfo.getNumBanks());
|
||||
}
|
||||
|
||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForPrivateSurfaceThenAllMemoryBanksAreOnAndPageTableClonningIsNotRequired) {
|
||||
AllocationProperties properties{mockRootDeviceIndex, false, 0u, GraphicsAllocation::AllocationType::PRIVATE_SURFACE, false, false, allTilesMask};
|
||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||
EXPECT_FALSE(storageInfo.cloningOfPageTables);
|
||||
EXPECT_EQ(allTilesMask, storageInfo.memoryBanks);
|
||||
EXPECT_EQ(allTilesMask, storageInfo.pageTablesVisibility);
|
||||
EXPECT_TRUE(storageInfo.tileInstanced);
|
||||
EXPECT_EQ(numDevices, storageInfo.getNumBanks());
|
||||
|
||||
properties.flags.multiOsContextCapable = true;
|
||||
auto storageInfo2 = memoryManager->createStorageInfoFromProperties(properties);
|
||||
EXPECT_FALSE(storageInfo2.cloningOfPageTables);
|
||||
EXPECT_EQ(allTilesMask, storageInfo2.memoryBanks);
|
||||
EXPECT_EQ(allTilesMask, storageInfo.pageTablesVisibility);
|
||||
EXPECT_TRUE(storageInfo2.tileInstanced);
|
||||
EXPECT_EQ(numDevices, storageInfo2.getNumBanks());
|
||||
EXPECT_EQ(4u, storageInfo.getNumBanks());
|
||||
}
|
||||
|
||||
TEST_F(MultiDeviceStorageInfoTest, givenMultiTileCsrWhenCreatingStorageInfoForInternalHeapThenSingleMemoryBankIsOnAndPageTableClonningIsRequired) {
|
||||
|
||||
@@ -66,12 +66,22 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
|
||||
}
|
||||
} break;
|
||||
case GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA:
|
||||
case GraphicsAllocation::AllocationType::PRIVATE_SURFACE:
|
||||
case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE:
|
||||
storageInfo.cloningOfPageTables = false;
|
||||
storageInfo.memoryBanks = allTilesValue;
|
||||
storageInfo.tileInstanced = true;
|
||||
break;
|
||||
case GraphicsAllocation::AllocationType::PRIVATE_SURFACE:
|
||||
storageInfo.cloningOfPageTables = false;
|
||||
|
||||
if (properties.subDevicesBitfield.count() == 1) {
|
||||
storageInfo.memoryBanks = preferredTile;
|
||||
storageInfo.pageTablesVisibility = preferredTile;
|
||||
} else {
|
||||
storageInfo.memoryBanks = allTilesValue;
|
||||
storageInfo.tileInstanced = true;
|
||||
}
|
||||
break;
|
||||
case GraphicsAllocation::AllocationType::COMMAND_BUFFER:
|
||||
case GraphicsAllocation::AllocationType::INTERNAL_HEAP:
|
||||
case GraphicsAllocation::AllocationType::LINEAR_STREAM:
|
||||
|
||||
Reference in New Issue
Block a user