Add support for new acronyms in disasm

The "disasm" option in ocloc was not validate new acronyms.
despite handling them in "compile".
This PR is fixing the issue - ocloc disasm supports new & deprecated
acronyms.

https://github.com/intel/compute-runtime/issues/582

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7509
This commit is contained in:
Daria Hinz
2022-11-15 15:24:52 +00:00
committed by Compute-Runtime-Automation
parent 4476e7ad76
commit 31deb4fd63
12 changed files with 184 additions and 35 deletions

View File

@@ -11,8 +11,6 @@
#include "hw_cmds.h"
#include "platforms.h"
#include <algorithm>
ProductConfigHelper::ProductConfigHelper() : deviceAotInfo({
#define DEVICE_CONFIG(productConfig, hwConfig, deviceIds, family, release) {{AOT::productConfig}, &NEO::hwConfig::hwInfo, &NEO::deviceIds, AOT::family, AOT::release},
#include "product_config.inl"
@@ -152,23 +150,31 @@ std::vector<NEO::ConstStringRef> ProductConfigHelper::getAllProductAcronyms() {
return allSupportedAcronyms;
}
PRODUCT_FAMILY ProductConfigHelper::getProductFamilyForAcronym(const std::string &device) const {
std::vector<DeviceAotInfo>::const_iterator it;
if (device.find(".") != std::string::npos) {
it = std::find_if(deviceAotInfo.begin(), deviceAotInfo.end(), findProductConfig(getProductConfigForVersionValue(device)));
} else {
it = std::find_if(deviceAotInfo.begin(), deviceAotInfo.end(), findAcronym(device));
}
if (it != deviceAotInfo.end())
return it->hwInfo->platform.eProductFamily;
return IGFX_UNKNOWN;
}
std::vector<NEO::ConstStringRef> ProductConfigHelper::getDeprecatedAcronyms() {
std::vector<NEO::ConstStringRef> prefixes{}, deprecatedAcronyms{}, enabledAcronyms{};
std::vector<NEO::ConstStringRef> prefixes{}, deprecatedAcronyms{};
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
if (NEO::hardwarePrefix[j] == nullptr)
continue;
prefixes.push_back(NEO::hardwarePrefix[j]);
}
for (const auto &device : deviceAotInfo) {
enabledAcronyms.insert(enabledAcronyms.end(), device.acronyms.begin(), device.acronyms.end());
}
for (const auto &prefix : prefixes) {
std::string prefixCopy = prefix.str();
ProductConfigHelper::adjustDeviceName(prefixCopy);
if (std::any_of(enabledAcronyms.begin(), enabledAcronyms.end(), ProductConfigHelper::findAcronymWithoutDash(prefixCopy)))
if (std::any_of(deviceAotInfo.begin(), deviceAotInfo.end(), findAcronym(prefixCopy)))
continue;
deprecatedAcronyms.push_back(prefix);
}

View File

@@ -9,6 +9,9 @@
#include "shared/source/utilities/const_stringref.h"
#include "igfxfmid.h"
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
@@ -87,6 +90,11 @@ struct ProductConfigHelper {
return [&lhs](const auto &rhs) { return lhs == rhs || rhs.isEqualWithoutSeparator('-', lhs.c_str()); };
}
template <typename EqComparableT>
static auto findAcronym(const EqComparableT &lhs) {
return [&lhs](const auto &rhs) { return std::any_of(rhs.acronyms.begin(), rhs.acronyms.end(), findAcronymWithoutDash(lhs)); };
}
template <typename EqComparableT>
static auto findFamily(const EqComparableT &lhs) {
return [&lhs](const auto &rhs) { return lhs == rhs.family; };
@@ -114,6 +122,7 @@ struct ProductConfigHelper {
std::vector<NEO::ConstStringRef> getFamiliesAcronyms();
std::vector<NEO::ConstStringRef> getDeprecatedAcronyms();
std::vector<NEO::ConstStringRef> getAllProductAcronyms();
PRODUCT_FAMILY getProductFamilyForAcronym(const std::string &device) const;
protected:
std::vector<DeviceAotInfo> deviceAotInfo;