mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Fatbinary optimization for -device release target
This commit is to introduce optimizations in ocloc when building targets for release and family. Instead of building fatbinary after all available targets in the RTL ID table, we introduce optimizations when there is an acronym available for the platform in the DEVICE table, we limit to them only. Signed-off-by: Daria Hinz <daria.hinz@intel.com> Related-To: NEO-7582
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b08a385f6b
commit
14f5a61993
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -107,10 +107,13 @@ bool ProductConfigHelper::isProductConfig(const std::string &device) {
|
||||
std::vector<NEO::ConstStringRef> ProductConfigHelper::getRepresentativeProductAcronyms() {
|
||||
std::vector<NEO::ConstStringRef> enabledAcronyms{};
|
||||
for (const auto &device : deviceAotInfo) {
|
||||
if (!device.acronyms.empty()) {
|
||||
enabledAcronyms.push_back(device.acronyms.front());
|
||||
if (!device.deviceAcronyms.empty()) {
|
||||
enabledAcronyms.push_back(device.deviceAcronyms.front());
|
||||
} else if (!device.rtlIdAcronyms.empty()) {
|
||||
enabledAcronyms.push_back(device.rtlIdAcronyms.front());
|
||||
}
|
||||
}
|
||||
|
||||
return enabledAcronyms;
|
||||
}
|
||||
|
||||
@@ -145,7 +148,8 @@ std::vector<NEO::ConstStringRef> ProductConfigHelper::getDeviceAcronyms() {
|
||||
std::vector<NEO::ConstStringRef> ProductConfigHelper::getAllProductAcronyms() {
|
||||
std::vector<NEO::ConstStringRef> allSupportedAcronyms{};
|
||||
for (const auto &device : deviceAotInfo) {
|
||||
allSupportedAcronyms.insert(allSupportedAcronyms.end(), device.acronyms.begin(), device.acronyms.end());
|
||||
allSupportedAcronyms.insert(allSupportedAcronyms.end(), device.deviceAcronyms.begin(), device.deviceAcronyms.end());
|
||||
allSupportedAcronyms.insert(allSupportedAcronyms.end(), device.rtlIdAcronyms.begin(), device.rtlIdAcronyms.end());
|
||||
}
|
||||
return allSupportedAcronyms;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -33,7 +33,8 @@ struct DeviceAotInfo {
|
||||
const std::vector<unsigned short> *deviceIds = nullptr;
|
||||
AOT::FAMILY family = {};
|
||||
AOT::RELEASE release = {};
|
||||
std::vector<NEO::ConstStringRef> acronyms{};
|
||||
std::vector<NEO::ConstStringRef> deviceAcronyms{};
|
||||
std::vector<NEO::ConstStringRef> rtlIdAcronyms{};
|
||||
|
||||
bool operator==(const DeviceAotInfo &rhs) {
|
||||
return aotConfig.value == rhs.aotConfig.value && family == rhs.family && release == rhs.release && hwInfo == rhs.hwInfo;
|
||||
@@ -80,7 +81,8 @@ struct ProductConfigHelper {
|
||||
|
||||
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)); };
|
||||
return [&lhs](const auto &rhs) { return std::any_of(rhs.deviceAcronyms.begin(), rhs.deviceAcronyms.end(), findAcronymWithoutDash(lhs)) ||
|
||||
std::any_of(rhs.rtlIdAcronyms.begin(), rhs.rtlIdAcronyms.end(), findAcronymWithoutDash(lhs)); };
|
||||
}
|
||||
|
||||
template <typename EqComparableT>
|
||||
@@ -98,6 +100,11 @@ struct ProductConfigHelper {
|
||||
return [&lhs](const auto &rhs) { return lhs == rhs.aotConfig.value; };
|
||||
}
|
||||
|
||||
template <typename EqComparableT>
|
||||
static auto findDeviceAcronymForRelease(const EqComparableT &lhs) {
|
||||
return [&lhs](const auto &rhs) { return lhs == rhs.release && !rhs.deviceAcronyms.empty(); };
|
||||
}
|
||||
|
||||
void initialize();
|
||||
bool isFamily(const std::string &device);
|
||||
bool isRelease(const std::string &device);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,7 +15,7 @@ void ProductConfigHelper::initialize() {
|
||||
for (auto &device : deviceAotInfo) {
|
||||
for (const auto &[acronym, value] : AOT::deviceAcronyms) {
|
||||
if (value == device.aotConfig.value) {
|
||||
device.acronyms.push_back(NEO::ConstStringRef(acronym));
|
||||
device.deviceAcronyms.push_back(NEO::ConstStringRef(acronym));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user