Skip to content

Commit 1bff5a7

Browse files
Dynamically expose VME extensions
Change-Id: Ia562361aeea70020cd99f813ea325fa88ca37006 Signed-off-by: Koska, Andrzej <[email protected]> Related-To: NEO-3416
1 parent 38556ce commit 1bff5a7

10 files changed

+35
-7
lines changed

offline_compiler/offline_compiler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ int OfflineCompiler::parseCommandLine(size_t numArgs, const std::vector<std::str
540540
printf("Error: Cannot get HW Info for device %s.\n", deviceName.c_str());
541541
} else {
542542
std::string extensionsList = getExtensionsList(*hwInfo);
543+
std::string vme("cl_intel_device_side_avc_motion_estimation ");
544+
if (extensionsList.find(vme) == std::string::npos)
545+
extensionsList += vme;
543546
internalOptions.append(convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str()));
544547
}
545548
}

runtime/device/device_caps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void Device::initializeCaps() {
147147
deviceInfo.packedYuvExtension = true;
148148
}
149149
if (DebugManager.flags.EnableIntelVme.get() && supportsVme) {
150-
deviceExtensions += "cl_intel_motion_estimation ";
150+
deviceExtensions += "cl_intel_motion_estimation cl_intel_device_side_avc_motion_estimation ";
151151
deviceInfo.vmeExtension = true;
152152
}
153153
if (DebugManager.flags.EnableIntelAdvancedVme.get() && supportsVme) {

runtime/gen11/hw_info_ehl.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const RuntimeCapabilityTable EHL::capabilityTable{
6363
true, // forceStatelessCompilationFor32Bit
6464
"lp", // platformType
6565
true, // sourceLevelDebuggerSupported
66-
true, // supportsVme
66+
false, // supportsVme
6767
false, // supportCacheFlushAfterWalker
6868
true // supportsImages
6969
};

runtime/gen11/hw_info_lkf.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{
5454
false, // ftrSupports64BitMath
5555
false, // ftrSvm
5656
true, // ftrSupportsCoherency
57-
true, // ftrSupportsVmeAvcTextureSampler
58-
true, // ftrSupportsVmeAvcPreemption
57+
false, // ftrSupportsVmeAvcTextureSampler
58+
false, // ftrSupportsVmeAvcPreemption
5959
false, // ftrRenderCompressedBuffers
6060
false, // ftrRenderCompressedImages
6161
true, // ftr64KBpages

runtime/platform/extensions.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const char *deviceExtensionsList = "cl_khr_3d_image_writes "
3030
"cl_intel_accelerator "
3131
"cl_intel_media_block_io "
3232
"cl_intel_driver_diagnostics "
33-
"cl_intel_device_side_avc_motion_estimation "
3433
"cl_khr_priority_hints "
3534
"cl_khr_throttle_hints "
3635
"cl_khr_create_command_queue ";
@@ -54,6 +53,10 @@ std::string getExtensionsList(const HardwareInfo &hwInfo) {
5453
allExtensionsList += "cl_khr_fp64 ";
5554
}
5655

56+
if (hwInfo.capabilityTable.supportsVme) {
57+
allExtensionsList += "cl_intel_motion_estimation cl_intel_device_side_avc_motion_estimation ";
58+
}
59+
5760
return allExtensionsList;
5861
}
5962

unit_tests/api/cl_get_device_info_tests.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ TEST_F(clGetDeviceInfoTests, GivenClDeviceExtensionsParamWhenGettingDeviceInfoTh
178178
"cl_intel_accelerator ",
179179
"cl_intel_media_block_io ",
180180
"cl_intel_driver_diagnostics ",
181-
"cl_intel_device_side_avc_motion_estimation ",
182181
};
183182

184183
for (auto element = 0u; element < sizeof(supportedExtensions) / sizeof(supportedExtensions[0]); element++) {

unit_tests/api/gl/cl_get_gl_device_info_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ TEST_P(GetDeviceGlInfoStr, StringType) {
6464
"cl_intel_accelerator",
6565
"cl_intel_media_block_io",
6666
"cl_intel_driver_diagnostics",
67-
"cl_intel_device_side_avc_motion_estimation",
6867
"cl_khr_gl_depth_images",
6968
"cl_khr_gl_event",
7069
"cl_khr_gl_msaa_sharing",

unit_tests/device/device_caps_tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreat
470470
const auto &caps = device->getDeviceInfo();
471471

472472
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_motion_estimation")));
473+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation")));
473474
EXPECT_TRUE(caps.vmeExtension);
474475

475476
EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_motion_estimate_intel"));
@@ -484,6 +485,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAr
484485
const auto &caps = device->getDeviceInfo();
485486

486487
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation"))));
488+
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation"))));
487489
EXPECT_FALSE(caps.vmeExtension);
488490

489491
EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel")));
@@ -498,6 +500,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsA
498500
const auto &caps = device->getDeviceInfo();
499501

500502
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation"))));
503+
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation"))));
501504
EXPECT_FALSE(caps.vmeExtension);
502505

503506
EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel")));
@@ -512,6 +515,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCrea
512515
const auto &caps = device->getDeviceInfo();
513516

514517
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation"))));
518+
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation"))));
515519
EXPECT_FALSE(caps.vmeExtension);
516520

517521
EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel")));

unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ TEST(EhlHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorr
5353

5454
using EhlHwInfo = ::testing::Test;
5555

56+
EHLTEST_F(EhlHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
57+
HardwareInfo hwInfo;
58+
59+
std::string strConfig = "1x4x8";
60+
hardwareInfoSetup[productFamily](&hwInfo, false, strConfig);
61+
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
62+
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
63+
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
64+
}
65+
5666
EHLTEST_F(EhlHwInfo, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
5767
bool boolValue[]{
5868
true, false};

unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ TEST(LkfHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorr
3939

4040
using LkfHwInfo = ::testing::Test;
4141

42+
LKFTEST_F(LkfHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
43+
HardwareInfo hwInfo;
44+
45+
std::string strConfig = "1x8x8";
46+
hardwareInfoSetup[productFamily](&hwInfo, false, strConfig);
47+
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
48+
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
49+
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
50+
}
51+
4252
LKFTEST_F(LkfHwInfo, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
4353
bool boolValue[]{
4454
true, false};

0 commit comments

Comments
 (0)