SWDEV-317716 - Add uuid in device info structure

Change-Id: Ie7f48d0faf7d722bd9bb8bd0f8962a7832dbe4f6


[ROCm/clr commit: 824704c87b]
This commit is contained in:
Satyanvesh Dittakavi
2022-01-13 14:04:42 +00:00
والد 1f9f598d92
کامیت 31aa18f1a9
2فایلهای تغییر یافته به همراه13 افزوده شده و 1 حذف شده
@@ -571,7 +571,8 @@ struct Info : public amd::EmbeddedObject {
uint32_t pcieRevisionId_;
//! ASIC Revision
uint32_t asicRevision_;
//! Returns the unique identifier for the device
char uuid_[16];
//! Max numbers of threads per CU
uint32_t maxThreadsPerCU_;
@@ -1075,6 +1075,17 @@ bool Device::populateOCLDeviceConstants() {
::strncpy(info_.boardName_, device_name, sizeof(info_.boardName_) - 1);
}
char unique_id[32] = {0};
if (HSA_STATUS_SUCCESS ==
hsa_agent_get_info(_bkendDevice, static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_UUID),
unique_id)) {
// ROCr gives the UUID info in the format GPU-XXXX with length 20 bytes
// Strip the first 4 bytes and store only the 16 bytes representing UUID
for (size_t i = 0; i < 16; i++) {
info_.uuid_[i] = unique_id[i+4];
}
}
if (HSA_STATUS_SUCCESS !=
hsa_agent_get_info(_bkendDevice,
(hsa_agent_info_t)HSA_AMD_AGENT_INFO_COOPERATIVE_COMPUTE_UNIT_COUNT,