From 1bff5a7bcb9902aec6de21aa7be20768f0878952 Mon Sep 17 00:00:00 2001 From: "Koska, Andrzej" Date: Thu, 18 Jul 2019 16:46:35 +0200 Subject: [PATCH] Dynamically expose VME extensions Change-Id: Ia562361aeea70020cd99f813ea325fa88ca37006 Signed-off-by: Koska, Andrzej Related-To: NEO-3416 --- offline_compiler/offline_compiler.cpp | 3 +++ runtime/device/device_caps.cpp | 2 +- runtime/gen11/hw_info_ehl.inl | 2 +- runtime/gen11/hw_info_lkf.inl | 4 ++-- runtime/platform/extensions.cpp | 5 ++++- unit_tests/api/cl_get_device_info_tests.inl | 1 - unit_tests/api/gl/cl_get_gl_device_info_tests.cpp | 1 - unit_tests/device/device_caps_tests.cpp | 4 ++++ unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp | 10 ++++++++++ unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp | 10 ++++++++++ 10 files changed, 35 insertions(+), 7 deletions(-) diff --git a/offline_compiler/offline_compiler.cpp b/offline_compiler/offline_compiler.cpp index 10436a1658..277358800f 100644 --- a/offline_compiler/offline_compiler.cpp +++ b/offline_compiler/offline_compiler.cpp @@ -540,6 +540,9 @@ int OfflineCompiler::parseCommandLine(size_t numArgs, const std::vectorgetDeviceInfo(); EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_motion_estimation"))); + EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation"))); EXPECT_TRUE(caps.vmeExtension); EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_motion_estimate_intel")); @@ -484,6 +485,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAr const auto &caps = device->getDeviceInfo(); EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation")))); + EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation")))); EXPECT_FALSE(caps.vmeExtension); EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel"))); @@ -498,6 +500,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsA const auto &caps = device->getDeviceInfo(); EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation")))); + EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation")))); EXPECT_FALSE(caps.vmeExtension); EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel"))); @@ -512,6 +515,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCrea const auto &caps = device->getDeviceInfo(); EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation")))); + EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation")))); EXPECT_FALSE(caps.vmeExtension); EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel"))); diff --git a/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp b/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp index 6b705e0986..bb7af15fb9 100644 --- a/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp +++ b/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp @@ -53,6 +53,16 @@ TEST(EhlHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorr using EhlHwInfo = ::testing::Test; +EHLTEST_F(EhlHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) { + HardwareInfo hwInfo; + + std::string strConfig = "1x4x8"; + hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); + EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler); + EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption); + EXPECT_FALSE(hwInfo.capabilityTable.supportsVme); +} + EHLTEST_F(EhlHwInfo, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { bool boolValue[]{ true, false}; diff --git a/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp b/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp index 5d4be9ba56..1e99f01059 100644 --- a/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp +++ b/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp @@ -39,6 +39,16 @@ TEST(LkfHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorr using LkfHwInfo = ::testing::Test; +LKFTEST_F(LkfHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) { + HardwareInfo hwInfo; + + std::string strConfig = "1x8x8"; + hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); + EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler); + EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption); + EXPECT_FALSE(hwInfo.capabilityTable.supportsVme); +} + LKFTEST_F(LkfHwInfo, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { bool boolValue[]{ true, false};