SWDEV-464927 - Update the Get by PCI BusId logic and Hop count
- Update the intra socket weight for partitions within single socket as it is changed to 13 by the driver. - Use the PCIe function to distinguish the partitions of the same device such as TPX mode in gfx942. Change-Id: I8e64023d44e37c2dbb105cbb343441a48021ba7b
このコミットが含まれているのは:
@@ -462,10 +462,12 @@ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusIdstr) {
|
|||||||
int pciBusID = -1;
|
int pciBusID = -1;
|
||||||
int pciDeviceID = -1;
|
int pciDeviceID = -1;
|
||||||
int pciDomainID = -1;
|
int pciDomainID = -1;
|
||||||
|
int pciFunction = -1;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
if (sscanf(pciBusIdstr, "%04x:%02x:%02x", reinterpret_cast<unsigned int*>(&pciDomainID),
|
if (sscanf(pciBusIdstr, "%04x:%02x:%02x.%01x", reinterpret_cast<unsigned int*>(&pciDomainID),
|
||||||
reinterpret_cast<unsigned int*>(&pciBusID),
|
reinterpret_cast<unsigned int*>(&pciBusID),
|
||||||
reinterpret_cast<unsigned int*>(&pciDeviceID)) == 0x3) {
|
reinterpret_cast<unsigned int*>(&pciDeviceID),
|
||||||
|
reinterpret_cast<unsigned int*>(&pciFunction)) == 0x4) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
HIP_RETURN_ONFAIL(ihipDeviceGetCount(&count));
|
HIP_RETURN_ONFAIL(ihipDeviceGetCount(&count));
|
||||||
for (cl_int i = 0; i < count; i++) {
|
for (cl_int i = 0; i < count; i++) {
|
||||||
@@ -473,9 +475,11 @@ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusIdstr) {
|
|||||||
hipDeviceProp_tR0600 prop;
|
hipDeviceProp_tR0600 prop;
|
||||||
HIP_RETURN_ONFAIL(ihipDeviceGet(&dev, i));
|
HIP_RETURN_ONFAIL(ihipDeviceGet(&dev, i));
|
||||||
HIP_RETURN_ONFAIL(ihipGetDeviceProperties(&prop, dev));
|
HIP_RETURN_ONFAIL(ihipGetDeviceProperties(&prop, dev));
|
||||||
|
auto* deviceHandle = g_devices[dev]->devices()[0];
|
||||||
|
|
||||||
if ((pciBusID == prop.pciBusID) && (pciDomainID == prop.pciDomainID) &&
|
if ((pciBusID == prop.pciBusID) && (pciDomainID == prop.pciDomainID) &&
|
||||||
(pciDeviceID == prop.pciDeviceID)) {
|
(pciDeviceID == prop.pciDeviceID) &&
|
||||||
|
(pciFunction == deviceHandle->info().deviceTopology_.pcie.function)) {
|
||||||
*device = i;
|
*device = i;
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -3356,7 +3356,7 @@ bool Device::findLinkInfo(const hsa_amd_memory_pool_t& pool,
|
|||||||
distance += link_info[hop_idx].numa_distance;
|
distance += link_info[hop_idx].numa_distance;
|
||||||
}
|
}
|
||||||
uint32_t oneHopDistance
|
uint32_t oneHopDistance
|
||||||
= (link_info[0].link_type == HSA_AMD_LINK_INFO_TYPE_XGMI) ? 15 : 20;
|
= (link_info[0].link_type == HSA_AMD_LINK_INFO_TYPE_XGMI) ? 13 : 20;
|
||||||
link_attr.second = static_cast<int32_t>(distance/oneHopDistance);
|
link_attr.second = static_cast<int32_t>(distance/oneHopDistance);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
新しいイシューから参照
ユーザーをブロックする