mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
fix: do not align to 64kb when requested alignment is bigger
Related-To: NEO-14082 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4b9010b87d
commit
33749b8b5a
@@ -385,6 +385,37 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryWithoutAllow64kbP
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryWithAllow64kbPagesFlagsIsAllocatedThen64kbAllocationIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MockMemoryManager memoryManager(true, false, executionEnvironment);
|
||||
AllocationData allocData;
|
||||
AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield);
|
||||
|
||||
memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties));
|
||||
allocData.flags.allow64kbPages = true;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
|
||||
EXPECT_TRUE(memoryManager.allocation64kbPageCreated);
|
||||
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenEnabled64kbPagesWhenAlignmentIsBiggerThan64kbThenNon64kbAllocationIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MockMemoryManager memoryManager(true, false, executionEnvironment);
|
||||
AllocationData allocData;
|
||||
AllocationProperties properties(mockRootDeviceIndex, 10, AllocationType::buffer, mockDeviceBitfield);
|
||||
|
||||
memoryManager.getAllocationData(allocData, properties, nullptr, memoryManager.createStorageInfoFromProperties(properties));
|
||||
allocData.flags.allow64kbPages = true;
|
||||
allocData.alignment = 2 * MemoryConstants::pageSize64k;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
|
||||
EXPECT_FALSE(memoryManager.allocation64kbPageCreated);
|
||||
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenDisabled64kbPagesWhenGraphicsMemoryMustBeHostMemoryAndIsAllocatedWithNullptrForBufferThenNon64kbAllocationIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MockMemoryManager memoryManager(false, false, executionEnvironment);
|
||||
|
||||
Reference in New Issue
Block a user