Move device UUID from L0 to shared

Related-To: NEO-5681

Signed-off-by: Baj, Tomasz <tomasz.baj@intel.com>
This commit is contained in:
Baj, Tomasz
2022-03-02 09:42:51 +00:00
committed by Compute-Runtime-Automation
parent 5118a5d3a6
commit 1f7fd45251
4 changed files with 31 additions and 11 deletions

View File

@@ -704,4 +704,13 @@ bool Device::generateUuidFromPciBusInfo(const PhysicalDevicePciBusInfo &pciBusIn
return false;
}
void Device::generateUuid(std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) {
const auto &deviceInfo = getDeviceInfo();
const auto &hardwareInfo = getHardwareInfo();
uint32_t rootDeviceIndex = getRootDeviceIndex();
uuid.fill(0);
memcpy_s(&uuid[0], sizeof(uint32_t), &deviceInfo.vendorId, sizeof(deviceInfo.vendorId));
memcpy_s(&uuid[4], sizeof(uint32_t), &hardwareInfo.platform.usDeviceID, sizeof(hardwareInfo.platform.usDeviceID));
memcpy_s(&uuid[8], sizeof(uint32_t), &rootDeviceIndex, sizeof(rootDeviceIndex));
}
} // namespace NEO

View File

@@ -134,6 +134,7 @@ class Device : public ReferenceTrackedObject<Device> {
uint64_t getGlobalMemorySize(uint32_t deviceBitfield) const;
const std::vector<SubDevice *> getSubDevices() const { return subdevices; }
bool getUuid(std::array<uint8_t, HwInfoConfig::uuidSize> &uuid);
void generateUuid(std::array<uint8_t, HwInfoConfig::uuidSize> &uuid);
protected:
Device() = delete;