mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Disable shareable allocs with huge size
Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
960d468107
commit
74e6c74071
@ -73,8 +73,14 @@ class MockWddmMemoryManager : public MemoryManagerCreate<WddmMemoryManager> {
|
||||
BaseClass::freeGraphicsMemoryImpl(gfxAllocation);
|
||||
}
|
||||
|
||||
GraphicsAllocation *allocateHugeGraphicsMemory(const AllocationData &allocationData, bool sharedVirtualAddress) override {
|
||||
allocateHugeGraphicsMemoryCalled = true;
|
||||
return BaseClass::allocateHugeGraphicsMemory(allocationData, sharedVirtualAddress);
|
||||
}
|
||||
|
||||
uint32_t freeGraphicsMemoryImplCalled = 0u;
|
||||
bool allocationGraphicsMemory64kbCreated = false;
|
||||
bool allocateGraphicsMemoryInNonDevicePool = false;
|
||||
bool allocateHugeGraphicsMemoryCalled = false;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -347,13 +347,27 @@ TEST_F(WddmMemoryManagerTest, givenAllocateGraphicsMemoryForNonSvmHostPtrIsCalle
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, GivenShareableEnabledWhenAskedToCreateGrahicsAllocationThenValidAllocationIsReturned) {
|
||||
TEST_F(WddmMemoryManagerSimpleTest, GivenShareableEnabledAndSmallSizeWhenAskedToCreateGrahicsAllocationThenValidAllocationIsReturned) {
|
||||
memoryManager.reset(new MockWddmMemoryManager(false, false, *executionEnvironment));
|
||||
memoryManager->hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k;
|
||||
AllocationData allocationData;
|
||||
allocationData.size = 4096u;
|
||||
allocationData.flags.shareable = true;
|
||||
auto allocation = memoryManager->allocateShareableMemory(allocationData);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_FALSE(memoryManager->allocateHugeGraphicsMemoryCalled);
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, GivenShareableEnabledAndHugeSizeWhenAskedToCreateGrahicsAllocationThenValidAllocationIsReturned) {
|
||||
memoryManager.reset(new MockWddmMemoryManager(false, false, *executionEnvironment));
|
||||
memoryManager->hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k;
|
||||
AllocationData allocationData;
|
||||
allocationData.size = 2ULL * MemoryConstants::pageSize64k;
|
||||
allocationData.flags.shareable = true;
|
||||
auto allocation = memoryManager->allocateShareableMemory(allocationData);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_TRUE(memoryManager->allocateHugeGraphicsMemoryCalled);
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user