mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
fix(ocloc): correct ocloc name in supported devices query
previous approach was to version ocloc library but it was deprecated right now there will be 2 known libraries: - libocloc.so - for mainstream - libocloc-legacy1.so for legacy platforms Related-To: NEO-12273, NEO-9630 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b063c3c62b
commit
922edfd68d
@@ -19,25 +19,24 @@ std::string SupportedDevicesHelper::getOutputFilenameSuffix(SupportedDevicesMode
|
||||
return "_supported_devices_" + toStr(mode) + fileExtension.data();
|
||||
}
|
||||
|
||||
std::string SupportedDevicesHelper::getOclocCurrentVersionOutputFilename() const {
|
||||
return getOclocCurrentVersion() + getOutputFilenameSuffix(mode);
|
||||
std::string SupportedDevicesHelper::getCurrentOclocOutputFilename() const {
|
||||
return getCurrentOclocName() + getOutputFilenameSuffix(mode);
|
||||
}
|
||||
|
||||
std::string SupportedDevicesHelper::getOclocCurrentVersion() const {
|
||||
return extractOclocVersion(getOclocCurrentLibName());
|
||||
std::string SupportedDevicesHelper::getCurrentOclocName() const {
|
||||
return extractOclocName(getOclocCurrentLibName());
|
||||
}
|
||||
|
||||
std::string SupportedDevicesHelper::getOclocFormerVersion() const {
|
||||
return extractOclocVersion(getOclocFormerLibName());
|
||||
}
|
||||
|
||||
std::string SupportedDevicesHelper::extractOclocVersion(std::string_view oclocLibNameWithVersion) const {
|
||||
// libocloc-2.0.so -> ocloc-2.0
|
||||
std::string_view view(oclocLibNameWithVersion);
|
||||
auto start = view.find("ocloc-");
|
||||
std::string SupportedDevicesHelper::extractOclocName(std::string_view oclocLibName) const {
|
||||
// libocloc.so -> ocloc
|
||||
// libocloc-legacy1.so -> ocloc-legacy1
|
||||
std::string_view view(oclocLibName);
|
||||
constexpr char prefix[] = "lib";
|
||||
auto start = view.find(prefix);
|
||||
if (start == std::string_view::npos) {
|
||||
return "ocloc";
|
||||
}
|
||||
start += strlen(prefix);
|
||||
|
||||
auto end = view.find(".so", start);
|
||||
if (end == std::string_view::npos) {
|
||||
@@ -47,7 +46,7 @@ std::string SupportedDevicesHelper::extractOclocVersion(std::string_view oclocLi
|
||||
return std::string(view.substr(start, end - start));
|
||||
}
|
||||
|
||||
std::string SupportedDevicesHelper::getDataFromFormerOclocVersion() const {
|
||||
std::string SupportedDevicesHelper::getDataFromFormerOcloc() const {
|
||||
std::string retData;
|
||||
|
||||
const char *argv[] = {"ocloc", "query", "SUPPORTED_DEVICES", "-concat"};
|
||||
|
||||
Reference in New Issue
Block a user