Add check for vme support

Change-Id: Ic51e87e1e049bce4ce8ce111e35b94d3806db21b
Signed-off-by: Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Cencelewska 2019-07-12 11:40:15 +02:00 committed by sys_ocldev
parent 5dc20f50d1
commit e4e5b5ccdf
3 changed files with 38 additions and 2 deletions

View File

@ -323,8 +323,10 @@ void Device::initializeCaps() {
deviceInfo.vmeAvcSupportsPreemption = hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption; deviceInfo.vmeAvcSupportsPreemption = hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption;
deviceInfo.vmeAvcSupportsTextureSampler = hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler; deviceInfo.vmeAvcSupportsTextureSampler = hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler;
if (hwInfo.capabilityTable.supportsVme) {
deviceInfo.vmeAvcVersion = CL_AVC_ME_VERSION_1_INTEL; deviceInfo.vmeAvcVersion = CL_AVC_ME_VERSION_1_INTEL;
deviceInfo.vmeVersion = CL_ME_VERSION_ADVANCED_VER_2_INTEL; deviceInfo.vmeVersion = CL_ME_VERSION_ADVANCED_VER_2_INTEL;
}
deviceInfo.platformHostTimerResolution = getPlatformHostTimerResolution(); deviceInfo.platformHostTimerResolution = getPlatformHostTimerResolution();
deviceInfo.internalDriverVersion = CL_DEVICE_DRIVER_VERSION_INTEL_NEO1; deviceInfo.internalDriverVersion = CL_DEVICE_DRIVER_VERSION_INTEL_NEO1;

View File

@ -1150,6 +1150,9 @@ TEST_F(BuiltInTests, createProgramFromCodeInternalOptionsFor32Bit) {
} }
TEST_F(BuiltInTests, whenQueriedProperVmeVersionIsReturned) { TEST_F(BuiltInTests, whenQueriedProperVmeVersionIsReturned) {
if (!pDevice->getHardwareInfo().capabilityTable.supportsVme) {
GTEST_SKIP();
}
cl_uint param; cl_uint param;
auto ret = pDevice->getDeviceInfo(CL_DEVICE_ME_VERSION_INTEL, sizeof(param), &param, nullptr); auto ret = pDevice->getDeviceInfo(CL_DEVICE_ME_VERSION_INTEL, sizeof(param), &param, nullptr);
EXPECT_EQ(CL_SUCCESS, ret); EXPECT_EQ(CL_SUCCESS, ret);

View File

@ -851,6 +851,37 @@ TEST(Device_GetCaps, givenDeviceWithNullSourceLevelDebuggerWhenCapsAreInitialize
EXPECT_FALSE(caps.sourceLevelDebuggerActive); EXPECT_FALSE(caps.sourceLevelDebuggerActive);
} }
TEST(Device_UseCaps, givenCapabilityTableWhenDeviceInitializeCapsThenVmeVersionsAreSetProperly) {
HardwareInfo hwInfo = *platformDevices[0];
cl_uint expectedVmeVersion = CL_ME_VERSION_ADVANCED_VER_2_INTEL;
cl_uint expectedVmeAvcVersion = CL_AVC_ME_VERSION_1_INTEL;
hwInfo.capabilityTable.supportsVme = 0;
hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler = 0;
hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption = 0;
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
device->initializeCaps();
EXPECT_EQ(0u, device->getDeviceInfo().vmeVersion);
EXPECT_EQ(0u, device->getDeviceInfo().vmeAvcVersion);
EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption, device->getDeviceInfo().vmeAvcSupportsPreemption);
EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler, device->getDeviceInfo().vmeAvcSupportsTextureSampler);
hwInfo.capabilityTable.supportsVme = 1;
hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler = 1;
hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption = 1;
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
device->initializeCaps();
EXPECT_EQ(expectedVmeVersion, device->getDeviceInfo().vmeVersion);
EXPECT_EQ(expectedVmeAvcVersion, device->getDeviceInfo().vmeAvcVersion);
EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption, device->getDeviceInfo().vmeAvcSupportsPreemption);
EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler, device->getDeviceInfo().vmeAvcSupportsTextureSampler);
}
typedef HwHelperTest DeviceCapsWithModifiedHwInfoTest; typedef HwHelperTest DeviceCapsWithModifiedHwInfoTest;
TEST_F(DeviceCapsWithModifiedHwInfoTest, givenPlatformWithSourceLevelDebuggerNotSupportedWhenDeviceIsCreatedThenSourceLevelDebuggerActiveIsSetToFalse) { TEST_F(DeviceCapsWithModifiedHwInfoTest, givenPlatformWithSourceLevelDebuggerNotSupportedWhenDeviceIsCreatedThenSourceLevelDebuggerActiveIsSetToFalse) {