Return CL_DEVICE_HOST_UNIFIED_MEMORY cap based on local memory

Change-Id: Ic896d9aca60a36618b30745db5bd38f98a0bd2e9
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2019-12-10 16:47:41 +01:00
committed by sys_ocldev
parent 39b997a276
commit 195f610fa3
2 changed files with 11 additions and 1 deletions

View File

@ -192,7 +192,7 @@ void Device::initializeCaps() {
deviceInfo.deviceType = CL_DEVICE_TYPE_GPU;
deviceInfo.vendorId = 0x8086;
deviceInfo.endianLittle = 1;
deviceInfo.hostUnifiedMemory = CL_TRUE;
deviceInfo.hostUnifiedMemory = (false == hwHelper.isLocalMemoryEnabled(hwInfo));
deviceInfo.deviceAvailable = CL_TRUE;
deviceInfo.compilerAvailable = CL_TRUE;
deviceInfo.preferredVectorWidthChar = 16;

View File

@ -656,6 +656,16 @@ TEST_F(DeviceGetCapsTest, givenDeviceThatDoesntHaveFp64ThenExtensionIsNotReporte
EXPECT_EQ(0u, caps.doubleFpConfig);
}
TEST_F(DeviceGetCapsTest, givenDeviceWhenGettingHostUnifiedMemoryCapThenItDependsOnLocalMemory) {
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily);
auto localMemoryEnabled = hwHelper.isLocalMemoryEnabled(*platformDevices[0]);
EXPECT_EQ((localMemoryEnabled == false), caps.hostUnifiedMemory);
}
TEST(DeviceGetCaps, givenDeviceThatDoesntHaveFp64WhenDbgFlagEnablesFp64ThenReportFp64Flags) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.OverrideDefaultFP64Settings.set(1);