mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Support the uppercase device deprecated acronyms
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0c523b412f
commit
74bca7f12e
@ -590,6 +590,51 @@ TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithRevisionWhenInitHwIn
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MockOfflineCompilerTests, givenAcronymWithUppercaseWhenInitHwInfoThenSuccessIsReturned) {
|
||||
MockOfflineCompiler mockOfflineCompiler;
|
||||
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
|
||||
if (allEnabledDeviceConfigs.empty()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
for (const auto &deviceMapConfig : allEnabledDeviceConfigs) {
|
||||
if (productFamily == deviceMapConfig.hwInfo->platform.eProductFamily) {
|
||||
if (!deviceMapConfig.acronyms.empty()) {
|
||||
mockOfflineCompiler.deviceName = deviceMapConfig.acronyms.front().str();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mockOfflineCompiler.deviceName.empty()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
std::transform(mockOfflineCompiler.deviceName.begin(), mockOfflineCompiler.deviceName.end(), mockOfflineCompiler.deviceName.begin(), ::toupper);
|
||||
EXPECT_EQ(mockOfflineCompiler.initHardwareInfo(mockOfflineCompiler.deviceName), OclocErrorCode::SUCCESS);
|
||||
}
|
||||
|
||||
TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithUppercaseWhenInitHwInfoThenSuccessIsReturned) {
|
||||
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();
|
||||
}
|
||||
|
||||
std::transform(mockOfflineCompiler.deviceName.begin(), mockOfflineCompiler.deviceName.end(), mockOfflineCompiler.deviceName.begin(), ::toupper);
|
||||
EXPECT_EQ(mockOfflineCompiler.initHardwareInfo(mockOfflineCompiler.deviceName), OclocErrorCode::SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenMaxDualSubSlicesSupportedIsSet, IsAtLeastGen12lp) {
|
||||
MockOfflineCompiler mockOfflineCompiler;
|
||||
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
|
||||
|
Reference in New Issue
Block a user