* Fix PCI Domain ID query

* Update BDF comment


[ROCm/clr commit: e2260d82a6]
Этот коммит содержится в:
Rahul Garg
2019-10-07 01:41:52 -07:00
коммит произвёл Maneesh Gupta
родитель 3096ae5ad7
Коммит 09bb83cf2c
+4 -2
Просмотреть файл
@@ -787,11 +787,13 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) {
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_BDFID, &bdf_id);
DeviceErrorCheck(err);
// BDFID is 16bit uint: [8bit - BusID | 5bit - Device ID | 3bit - Function/DomainID]
prop->pciDomainID = bdf_id & 0x7;
// BDFID is 16bit uint: [8bit - BusID | 5bit - Device ID | 3bit - FunctionID]
prop->pciDeviceID = (bdf_id >> 3) & 0x1F;
prop->pciBusID = (bdf_id >> 8) & 0xFF;
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_DOMAIN, &prop->pciDomainID);
DeviceErrorCheck(err);
// Masquerade as a 3.0-level device. This will change as more HW functions are properly
// supported. Application code should use the arch.has* to do detailed feature detection.
prop->major = 3;