fix: don't query ipVersion if not supported

Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-06-12 13:02:20 +00:00
committed by Compute-Runtime-Automation
parent 8bc1fb1251
commit 0605716499
2 changed files with 40 additions and 7 deletions

View File

@@ -731,6 +731,11 @@ TEST(IoctlHelperPrelimTest, givenProgramDebuggingAndContextDebugSupportedWhenIni
}
TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenInitializatedThenIpVersionIsSet) {
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
if (productHelper.isPlatformQuerySupported() == false) {
GTEST_SKIP();
}
auto &ipVersion = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->ipVersion;
ipVersion = {};
drm->ioctlHelper->setupIpVersion();
@@ -739,6 +744,21 @@ TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenInitializatedThenIpVersionI
EXPECT_EQ(ipVersion.architecture, 3u);
}
TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperAndPlatformQueryNotSupportedWhenSetupIpVersionThenIpVersionIsSetFromHelper) {
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
if (productHelper.isPlatformQuerySupported() == true) {
GTEST_SKIP();
}
auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto &ipVersion = hwInfo->ipVersion;
ipVersion = {};
drm->ioctlHelper->setupIpVersion();
auto config = compilerProductHelper.getHwIpVersion(*hwInfo);
EXPECT_EQ(config, ipVersion.value);
}
TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenFailOnInitializationThenIpVersionIsCorrect) {
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
@@ -751,6 +771,12 @@ TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenFailOnInitializationThenIpV
}
TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenInvalidHwIpVersionSizeOnInitializationThenErrorIsPrinted) {
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
if (productHelper.isPlatformQuerySupported() == false) {
GTEST_SKIP();
}
DebugManagerStateRestore restore;
DebugManager.flags.PrintDebugMessages.set(true);