2
0

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
Este cometimento está contido em:
Satyanvesh Dittakavi
2024-06-06 08:34:09 +00:00
ascendente 8f42ad6aa3
cometimento 1815fc808d
2 ficheiros modificados com 8 adições e 4 eliminações
+7 -3
Ver ficheiro
@@ -462,10 +462,12 @@ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusIdstr) {
int pciBusID = -1;
int pciDeviceID = -1;
int pciDomainID = -1;
int pciFunction = -1;
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*>(&pciDeviceID)) == 0x3) {
reinterpret_cast<unsigned int*>(&pciDeviceID),
reinterpret_cast<unsigned int*>(&pciFunction)) == 0x4) {
int count = 0;
HIP_RETURN_ONFAIL(ihipDeviceGetCount(&count));
for (cl_int i = 0; i < count; i++) {
@@ -473,9 +475,11 @@ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusIdstr) {
hipDeviceProp_tR0600 prop;
HIP_RETURN_ONFAIL(ihipDeviceGet(&dev, i));
HIP_RETURN_ONFAIL(ihipGetDeviceProperties(&prop, dev));
auto* deviceHandle = g_devices[dev]->devices()[0];
if ((pciBusID == prop.pciBusID) && (pciDomainID == prop.pciDomainID) &&
(pciDeviceID == prop.pciDeviceID)) {
(pciDeviceID == prop.pciDeviceID) &&
(pciFunction == deviceHandle->info().deviceTopology_.pcie.function)) {
*device = i;
found = true;
break;