Switch device ID support to product config helper

This commit switches the device ID logic from the deprecated
to the new one, so that if the user passes a hex value to the -device
parameter, ocloc will use the new implementation in the product config
helper. The change also introduces a fix for setting the values in the
correct order to configure the hwIfno correctly.

Signed-off-by: Daria Hinz daria.hinz@intel.com
Related-To: NEO-7487
This commit is contained in:
Daria Hinz
2022-11-16 14:01:51 +00:00
committed by Compute-Runtime-Automation
parent 43ff955199
commit 59109a08bb
11 changed files with 160 additions and 106 deletions

View File

@@ -74,6 +74,28 @@ AOT::FAMILY ProductConfigHelper::getFamilyForAcronym(const std::string &device)
return it->second;
}
const std::string ProductConfigHelper::getAcronymForProductConfig(AOT::PRODUCT_CONFIG config) const {
auto it = std::find_if(deviceAotInfo.begin(), deviceAotInfo.end(), findProductConfig(config));
if (it == deviceAotInfo.end()) {
return {};
}
if (!it->deviceAcronyms.empty()) {
return it->deviceAcronyms.front().str();
} else if (!it->rtlIdAcronyms.empty()) {
return it->rtlIdAcronyms.front().str();
} else
return parseMajorMinorRevisionValue(it->aotConfig);
}
AOT::PRODUCT_CONFIG ProductConfigHelper::getProductConfigForDeviceId(unsigned short deviceId) const {
for (const auto &device : deviceAotInfo) {
if (std::find(device.deviceIds->begin(), device.deviceIds->end(), deviceId) != device.deviceIds->end()) {
return static_cast<AOT::PRODUCT_CONFIG>(device.aotConfig.value);
}
}
return AOT::UNKNOWN_ISA;
}
bool ProductConfigHelper::isRelease(const std::string &device) {
auto release = getReleaseForAcronym(device);
if (release == AOT::UNKNOWN_RELEASE) {

View File

@@ -118,6 +118,8 @@ struct ProductConfigHelper {
std::vector<NEO::ConstStringRef> getDeprecatedAcronyms();
std::vector<NEO::ConstStringRef> getAllProductAcronyms();
PRODUCT_FAMILY getProductFamilyForAcronym(const std::string &device) const;
AOT::PRODUCT_CONFIG getProductConfigForDeviceId(unsigned short deviceId) const;
const std::string getAcronymForProductConfig(AOT::PRODUCT_CONFIG config) const;
protected:
std::vector<DeviceAotInfo> deviceAotInfo;