@@ -305,6 +305,27 @@ TEST_F(AubMemoryOperationsHandlerTests, givenLocalMemoryAndNonLocalMemoryAllocat
305
305
device->getDefaultEngine ().commandStreamReceiver = oldCsr;
306
306
}
307
307
308
+ TEST_F (AubMemoryOperationsHandlerTests, givenNonLocalMemoryAllocationWithStorageInfoNonZeroWhenMakeResidentCalledThenSystemMemoryBankIsPassedToWriteMemory) {
309
+ auto executionEnvironment = device->getExecutionEnvironment ();
310
+ executionEnvironment->prepareRootDeviceEnvironments (1 );
311
+ executionEnvironment->rootDeviceEnvironments [0 ]->setHwInfoAndInitHelpers (&hardwareInfo);
312
+ executionEnvironment->initializeMemoryManager ();
313
+
314
+ MemoryAllocation allocation (0 , 1u /* num gmms*/ , AllocationType::unknown, nullptr , reinterpret_cast <void *>(0x1000 ), 0x1000u ,
315
+ MemoryConstants::pageSize, 0 , MemoryPool::system64KBPages, false , false , MemoryManager::maxOsContextCount);
316
+ allocation.storageInfo .memoryBanks = 0x3u ;
317
+ MockAubManager aubManager;
318
+ aubManager.storeAllocationParams = true ;
319
+ getMemoryOperationsHandler ()->setAubManager (&aubManager);
320
+ auto memoryOperationsInterface = getMemoryOperationsHandler ();
321
+
322
+ allocPtr = &allocation;
323
+ memoryOperationsInterface->makeResident (device.get (), ArrayRef<GraphicsAllocation *>(&allocPtr, 1 ), false );
324
+
325
+ EXPECT_TRUE (aubManager.writeMemory2Called );
326
+ EXPECT_EQ (0u , aubManager.storedAllocationParams [0 ].memoryBanks );
327
+ }
328
+
308
329
TEST_F (AubMemoryOperationsHandlerTests, givenLocalMemoryNoncloneableAllocationWithManyBanksWhenGetMemoryBanksBitfieldThenSingleMemoryBankIsReturned) {
309
330
auto executionEnvironment = device->getExecutionEnvironment ();
310
331
executionEnvironment->prepareRootDeviceEnvironments (1 );
0 commit comments