@@ -1607,6 +1607,42 @@ HWTEST_P(UpdateResidencyContainerMultipleDevicesTest, givenAllocationItIsAddedTo
16071607 }
16081608}
16091609
1610+ HWTEST_P (UpdateResidencyContainerMultipleDevicesTest,
1611+ whenUsingRootDeviceIndexGreaterThanMultiGraphicsAllocationSizeThenNoAllocationsAreAdded) {
1612+ uint32_t pCmdBuffer[1024 ];
1613+ MockGraphicsAllocation gfxAllocation (device->getDevice ().getRootDeviceIndex (),
1614+ static_cast <void *>(pCmdBuffer), sizeof (pCmdBuffer));
1615+ SvmAllocationData allocData (maxRootDeviceIndex);
1616+ allocData.gpuAllocations .addAllocation (&gfxAllocation);
1617+ allocData.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1618+ allocData.device = &device->getDevice ();
1619+
1620+ uint32_t pCmdBufferPeer[1024 ];
1621+ MockGraphicsAllocation gfxAllocationPeer (peerDevice->getDevice ().getRootDeviceIndex (),
1622+ (void *)pCmdBufferPeer, sizeof (pCmdBufferPeer));
1623+ SvmAllocationData allocDataPeer (maxRootDeviceIndex);
1624+ allocDataPeer.gpuAllocations .addAllocation (&gfxAllocationPeer);
1625+ allocDataPeer.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1626+ allocDataPeer.device = &peerDevice->getDevice ();
1627+
1628+ svmManager->insertSVMAlloc (allocData);
1629+ svmManager->insertSVMAlloc (allocDataPeer);
1630+ EXPECT_EQ (2u , svmManager->getNumAllocs ());
1631+
1632+ ResidencyContainer residencyContainer;
1633+ EXPECT_EQ (0u , residencyContainer.size ());
1634+ svmManager->addInternalAllocationsToResidencyContainer (numRootDevices + 1 ,
1635+ residencyContainer,
1636+ InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1637+ EXPECT_EQ (0u , residencyContainer.size ());
1638+
1639+ svmManager->addInternalAllocationsToResidencyContainer (device->getDevice ().getRootDeviceIndex (),
1640+ residencyContainer,
1641+ InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1642+ EXPECT_EQ (1u , residencyContainer.size ());
1643+ EXPECT_EQ (residencyContainer[0 ]->getGpuAddress (), gfxAllocation.getGpuAddress ());
1644+ }
1645+
16101646MemoryAllocationTypeArray memoryTypeArray;
16111647INSTANTIATE_TEST_SUITE_P (UpdateResidencyContainerMultipleDevicesTests,
16121648 UpdateResidencyContainerMultipleDevicesTest,
0 commit comments