From 01c36a38c678bca20308c13a1b96ad1d1849b3f1 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Thu, 6 Jun 2024 09:30:04 +0000 Subject: [PATCH] feature: add support for generic id acronyms in ocloc Related-To: NEO-11568 Signed-off-by: Mateusz Jablonski --- manifests/manifest.yml | 2 +- shared/source/helpers/product_config_helper.cpp | 11 +++++++++++ .../unit_test/helpers/product_config_helper_tests.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/manifests/manifest.yml b/manifests/manifest.yml index dbf74423a5..051abc0b6e 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -31,7 +31,7 @@ components: branch: master dest_dir: infra fetch_tags: true - revision: v6041 + revision: v6049 type: git internal: branch: master diff --git a/shared/source/helpers/product_config_helper.cpp b/shared/source/helpers/product_config_helper.cpp index bee5097245..acb27d4a1b 100644 --- a/shared/source/helpers/product_config_helper.cpp +++ b/shared/source/helpers/product_config_helper.cpp @@ -309,6 +309,12 @@ void ProductConfigHelper::initialize() { device.rtlIdAcronyms.push_back(NEO::ConstStringRef(acronym)); } } + + for (const auto &[acronym, value] : AOT::genericIdAcronyms) { + if (value == device.aotConfig.value) { + device.deviceAcronyms.push_back(NEO::ConstStringRef(acronym)); + } + } } } @@ -322,5 +328,10 @@ AOT::PRODUCT_CONFIG ProductConfigHelper::getProductConfigFromAcronym(const std:: if (rtlIdAcronymIt != AOT::rtlIdAcronyms.end()) { return rtlIdAcronymIt->second; } + + auto genericIdAcronymIt = std::find_if(AOT::genericIdAcronyms.begin(), AOT::genericIdAcronyms.end(), findMapAcronymWithoutDash(device)); + if (genericIdAcronymIt != AOT::genericIdAcronyms.end()) { + return genericIdAcronymIt->second; + } return AOT::UNKNOWN_ISA; } diff --git a/shared/test/unit_test/helpers/product_config_helper_tests.cpp b/shared/test/unit_test/helpers/product_config_helper_tests.cpp index 9413da9887..090cdf54be 100644 --- a/shared/test/unit_test/helpers/product_config_helper_tests.cpp +++ b/shared/test/unit_test/helpers/product_config_helper_tests.cpp @@ -268,6 +268,12 @@ TEST_F(AotDeviceInfoTests, givenProductAcronymWhenHelperSearchForAMatchThenCorre EXPECT_LT(0u, numSupportedAcronyms); } +TEST_F(AotDeviceInfoTests, givenGenericAcronymWhenHelperSearchForAMatchThenCorrespondingValueIsReturned) { + for (const auto &[acronym, value] : AOT::genericIdAcronyms) { + EXPECT_EQ(productConfigHelper->getProductConfigFromDeviceName(acronym), value); + } +} + TEST_F(AotDeviceInfoTests, givenProductIpVersionStringWhenHelperSearchForProductConfigThenCorrectValueIsReturned) { for (const auto &deviceConfig : AOT::deviceAcronyms) { if (!productConfigHelper->isSupportedProductConfig(deviceConfig.second)) {