Ocloc: Support for various variants of acronyms

In addition to supporting the official -device acronyms
(e.g. xe-hpg), support for shorter and deprecated acronyms
has also been added.
An example of supported variances:
- xehpg
- xe_hpg
- xe_hpg_core

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-6910
This commit is contained in:
Daria Hinz
2022-06-14 14:49:57 +02:00
committed by Compute-Runtime-Automation
parent 9996228281
commit 2637ae5816
15 changed files with 623 additions and 82 deletions

View File

@@ -568,6 +568,28 @@ TEST_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenBaseHa
EXPECT_NE(mockOfflineCompiler.hwInfo.gtSystemInfo.MaxSubSlicesSupported, 0u);
}
TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithRevisionWhenInitHwInfoThenValuesAreSetAndSuccessIsReturned) {
MockOfflineCompiler mockOfflineCompiler;
auto deprecatedAcronyms = mockOfflineCompiler.getDeprecatedDevicesTypes();
if (deprecatedAcronyms.empty()) {
GTEST_SKIP();
}
auto acronyms = CompilerOptions::tokenize(deprecatedAcronyms, ',');
for (const auto &deprecatedAcronym : acronyms) {
if (deprecatedAcronym.contains(" ")) {
auto name = deprecatedAcronym.str();
auto space = name.find(" ");
mockOfflineCompiler.deviceName = name.substr(++space, name.size());
} else {
mockOfflineCompiler.deviceName = deprecatedAcronym.str();
}
mockOfflineCompiler.revisionId = 0x3;
EXPECT_EQ(mockOfflineCompiler.initHardwareInfo(mockOfflineCompiler.deviceName), OclocErrorCode::SUCCESS);
EXPECT_EQ(mockOfflineCompiler.hwInfo.platform.usRevId, mockOfflineCompiler.revisionId);
}
}
HWTEST2_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenMaxDualSubSlicesSupportedIsSet, IsAtLeastGen12lp) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();