Account for hwInfo when checking for implicit scaling support

Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
This commit is contained in:
Raiyan Latif
2022-03-15 08:40:50 +00:00
committed by Compute-Runtime-Automation
parent 71abef22bd
commit f6c5995219
2 changed files with 31 additions and 2 deletions

View File

@@ -130,6 +130,34 @@ TEST_F(DeviceGetCapsTest,
EXPECT_TRUE(pDevice->getDeviceInfo().maxMemAllocSize < pDevice->getDeviceInfo().globalMemSize);
}
TEST_F(DeviceGetCapsTest,
givenImplicitScalingTrueWhenInitializeCapsIsCalledThenMaxMemAllocSizeIsSetCorrectly) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.CreateMultipleSubDevices.set(4);
pDevice->deviceBitfield = 15;
DebugManager.flags.EnableImplicitScaling.set(1);
DebugManager.flags.EnableWalkerPartition.set(1);
DebugManager.flags.EnableSharedSystemUsmSupport.set(1);
pDevice->initializeCaps();
EXPECT_TRUE(pDevice->getDeviceInfo().maxMemAllocSize == pDevice->getDeviceInfo().globalMemSize);
}
TEST_F(DeviceGetCapsTest,
givenImplicitScalingFalseWhenInitializeCapsIsCalledThenMaxMemAllocSizeIsSetCorrectly) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.CreateMultipleSubDevices.set(4);
pDevice->deviceBitfield = 15;
DebugManager.flags.EnableImplicitScaling.set(0);
DebugManager.flags.EnableWalkerPartition.set(1);
DebugManager.flags.EnableSharedSystemUsmSupport.set(1);
pDevice->initializeCaps();
EXPECT_TRUE(pDevice->getDeviceInfo().maxMemAllocSize <= pDevice->getDeviceInfo().globalMemSize);
}
TEST_F(DeviceGetCapsTest, givenDontForcePreemptionModeDebugVariableWhenCreateDeviceThenSetDefaultHwPreemptionMode) {
DebugManagerStateRestore dbgRestorer;
{
@@ -315,4 +343,4 @@ TEST_F(DeviceGetCapsTest, givenFlagEnabled64kbPagesWhenCallConstructorMemoryMana
DebugManager.flags.Enable64kbpages.set(1); // force true
memoryManager.reset(new MockMemoryManager(executionEnvironment));
EXPECT_TRUE(memoryManager->peek64kbPagesEnabled(0u));
}
}