mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Control enabling of local memory based on OS and HW Capabilities part 2
- add EnableLocalMemory debug variable - separate OSInterface::osEnableLocalMemory for dll and unit tests Change-Id: I78a1f60364eece28b30ce3e91418e7d72ba3e0d9
This commit is contained in:
committed by
sys_ocldev
parent
8dc28f2445
commit
1822fb0747
@@ -768,11 +768,14 @@ TEST(Device_GetCaps, givenDeviceWithNullSourceLevelDebuggerWhenCapsAreInitialize
|
||||
|
||||
typedef HwHelperTest DeviceCapsWithModifiedHwInfoTest;
|
||||
|
||||
TEST_F(DeviceCapsWithModifiedHwInfoTest, GivenLocalMemorySupportedAndOsEnableLocalMemoryWhenSetThenGetEnableLocalMemoryReturnCorrectValue) {
|
||||
TEST_F(DeviceCapsWithModifiedHwInfoTest, GivenLocalMemorySupportedAndOsEnableLocalMemoryAndEnableLocalMemoryDebugVarWhenSetThenGetEnableLocalMemoryReturnCorrectValue) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
VariableBackup<bool> orgOsEnableLocalMemory(&OSInterface::osEnableLocalMemory);
|
||||
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
||||
bool orgHwCapsLocalMemorySupported = device->getHardwareCapabilities().localMemorySupported;
|
||||
|
||||
DebugManager.flags.EnableLocalMemory.set(false);
|
||||
|
||||
device->setHWCapsLocalMemorySupported(false);
|
||||
OSInterface::osEnableLocalMemory = false;
|
||||
EXPECT_FALSE(device->getEnableLocalMemory());
|
||||
@@ -789,6 +792,9 @@ TEST_F(DeviceCapsWithModifiedHwInfoTest, GivenLocalMemorySupportedAndOsEnableLoc
|
||||
OSInterface::osEnableLocalMemory = true;
|
||||
EXPECT_TRUE(device->getEnableLocalMemory());
|
||||
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
EXPECT_TRUE(device->getEnableLocalMemory());
|
||||
|
||||
device->setHWCapsLocalMemorySupported(orgHwCapsLocalMemorySupported);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user