mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
sys_ocldev

parent
39b997a276
commit
195f610fa3
@ -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;
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user