@@ -162,6 +162,30 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesEnabledWhenAl
162162 memoryManager->freeGraphicsMemory (allocation);
163163}
164164
165+ TEST_F (WddmMemoryManagerSimpleTest, givenAllocationDataWithStorageInfoWhenAllocateGraphicsMemory64kbThenStorageInfoInAllocationIsSetCorrectly) {
166+ memoryManager.reset (new MockWddmMemoryManager (false , false , *executionEnvironment));
167+ AllocationData allocationData;
168+ allocationData.storageInfo = {};
169+ auto allocation = memoryManager->allocateGraphicsMemory64kb (allocationData);
170+ EXPECT_NE (nullptr , allocation);
171+ EXPECT_TRUE (memcmp (&allocationData.storageInfo , &allocation->storageInfo , sizeof (StorageInfo)) == 0 );
172+ memoryManager->freeGraphicsMemory (allocation);
173+ }
174+
175+ TEST_F (WddmMemoryManagerSimpleTest, givenAllocationDataWithFlagsWhenAllocateGraphicsMemory64kbThenAllocationFlagFlushL3RequiredIsSetCorrectly) {
176+ class MockGraphicsAllocation : public GraphicsAllocation {
177+ public:
178+ using GraphicsAllocation::allocationInfo;
179+ };
180+ memoryManager.reset (new MockWddmMemoryManager (false , false , *executionEnvironment));
181+ AllocationData allocationData;
182+ allocationData.flags .flushL3 = true ;
183+ auto allocation = static_cast <MockGraphicsAllocation *>(memoryManager->allocateGraphicsMemory64kb (allocationData));
184+ EXPECT_NE (nullptr , allocation);
185+ EXPECT_EQ (allocationData.flags .flushL3 , allocation->allocationInfo .flags .flushL3Required );
186+ memoryManager->freeGraphicsMemory (allocation);
187+ }
188+
165189TEST_F (WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocateGraphicsMemoryWithPtrIsCalledThenMemoryPoolIsSystem4KBPages) {
166190 memoryManager.reset (new MockWddmMemoryManager (false , false , *executionEnvironment));
167191 void *ptr = reinterpret_cast <void *>(0x1001 );
0 commit comments