SWDEV-387508 - construct uuid from pal props

This reverts commit e83c7a0510195fda6640c22d7ad98f056cf95dcd.

Reason for revert: it is a test issue to consider uuid a string it is array of values 

Change-Id: Ifb2ae05a99cdaa80e689b83693fc553dd974a249


[ROCm/clr commit: 471ff60a90]
This commit is contained in:
Shadi Dashmiz
2023-03-21 15:49:03 -04:00
committed by Maneesh Gupta
parent e6d6b4e80c
commit f1671e8eda
+6 -12
View File
@@ -327,6 +327,12 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp,
uint numExclusiveComputeRings) {
info_.type_ = CL_DEVICE_TYPE_GPU;
info_.vendorId_ = palProp.vendorId;
// Set uuid
memcpy(info_.uuid_, &palProp.pciProperties.domainNumber, sizeof(uint32_t));
memcpy(info_.uuid_ + 4, &palProp.pciProperties.busNumber, sizeof(uint32_t));
memcpy(info_.uuid_ + 8, &palProp.pciProperties.deviceNumber, sizeof(uint32_t));
memcpy(info_.uuid_ + 12, &palProp.pciProperties.functionNumber, sizeof(uint32_t));
info_.maxWorkItemDimensions_ = 3;
info_.maxComputeUnits_ = settings().enableWgpMode_
@@ -838,24 +844,12 @@ uint32_t gNumDevices = 0;
bool Device::create(Pal::IDevice* device) {
resourceList_ = new std::unordered_set<Resource*>();
char uuidByte[4];
if (nullptr == resourceList_) {
return false;
}
appProfile_.init();
device_ = device;
// Construct uuid from pal prop
memset(info_.uuid_, 0, sizeof(info_.uuid_));
sprintf(uuidByte, "%04x", properties().pciProperties.domainNumber);
strncpy(info_.uuid_, uuidByte, 4);
sprintf(uuidByte, "%04x", properties().pciProperties.busNumber);
strncpy(info_.uuid_+4, uuidByte, 4);
sprintf(uuidByte, "%04x", properties().pciProperties.deviceNumber);
strncpy(info_.uuid_+8, uuidByte, 4);
sprintf(uuidByte, "%04x", properties().pciProperties.functionNumber);
strncpy(info_.uuid_+12, uuidByte, 4);
// Retrive device properties
Pal::Result result = iDev()->GetProperties(&properties_);
if (result != Pal::Result::Success) {