Add uuid support using inband information

Added chipset specific uuid retrieving functionality
This is used by zeDeviceGetProperties


Related-To: LOCI-2636

Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
Joshua Santosh Ranjan
2021-11-26 09:40:06 +00:00
committed by Compute-Runtime-Automation
parent cf70a57efb
commit 06be26fd1e
22 changed files with 1202 additions and 10 deletions

View File

@@ -13,7 +13,7 @@
#include <unistd.h>
namespace NEO {
std::optional<std::string> getPciPath(int deviceFd) {
std::optional<std::string> getPciLinkPath(int deviceFd) {
char path[256] = {0};
size_t pathlen = 256;
@@ -33,9 +33,17 @@ std::optional<std::string> getPciPath(int deviceFd) {
return std::nullopt;
}
std::string_view devicePathView(devicePath, static_cast<size_t>(readLinkSize));
devicePathView = devicePathView.substr(devicePathView.find("/drm/render") - 12u, 12u);
return std::string(devicePath, static_cast<size_t>(readLinkSize));
}
return std::string(devicePathView);
std::optional<std::string> getPciPath(int deviceFd) {
auto deviceLinkPath = NEO::getPciLinkPath(deviceFd);
if (deviceLinkPath == std::nullopt) {
return std::nullopt;
}
return deviceLinkPath->substr(deviceLinkPath->find("/drm/render") - 12u, 12u);
}
} // namespace NEO