fix: Add experimental debug toggle to force 2M local memory size alignment

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2024-06-27 14:13:43 +00:00
committed by Compute-Runtime-Automation
parent 940f23ddbf
commit 6992cb8aeb
6 changed files with 57 additions and 0 deletions

View File

@@ -1941,6 +1941,17 @@ TEST_F(WddmMemoryManagerSimpleTest, givenCustomAlignmentBiggerThan2MbAndAllocati
testAlignment(size, expectedAlignment);
}
TEST_F(WddmMemoryManagerSimpleTest, givenForced2MBSizeAlignmentWhenAllocationInDevicePoolIsCreatedThenUseProperAlignment) {
debugManager.flags.ExperimentalAlignLocalMemorySizeTo2MB.set(true);
uint32_t size = 1;
uint32_t expectedAlignment = MemoryConstants::pageSize2M;
testAlignment(size, expectedAlignment);
size = 1 + MemoryConstants::pageSize2M;
testAlignment(size, expectedAlignment);
}
TEST_F(WddmMemoryManagerSimpleTest, givenAllocationLessThen2MbWhenAllocationInDevicePoolIsCreatedThenUse64KbAlignment) {
const uint32_t expectedAlignment = MemoryConstants::pageSize64k;
const uint32_t size = 2 * MemoryConstants::megaByte - 1;