Fix hipDeviceGetByPCIBusId
SWDEV-260845 Change-Id: I2d6db15906d794c9ebfa85b745a2c1bbb6f3e731
Este commit está contenido en:
@@ -337,12 +337,13 @@ hipError_t hipDeviceGetByPCIBusId(int* device, const char*pciBusIdstr) {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
ihipDeviceGetCount(&count);
|
ihipDeviceGetCount(&count);
|
||||||
for (cl_int i = 0; i < count; i++) {
|
for (cl_int i = 0; i < count; i++) {
|
||||||
int pi = 0;
|
|
||||||
hipDevice_t dev;
|
hipDevice_t dev;
|
||||||
hipDeviceGet(&dev, i);
|
hipDeviceGet(&dev, i);
|
||||||
hipDeviceGetAttribute(&pi, hipDeviceAttributePciBusId, dev);
|
hipDeviceProp_t prop;
|
||||||
|
hipGetDeviceProperties(&prop, dev);
|
||||||
|
|
||||||
if (pciBusID == pi) {
|
if ((pciBusID == prop.pciBusID) && (pciDomainID == prop.pciDomainID)
|
||||||
|
&& (pciDeviceID == prop.pciDeviceID)) {
|
||||||
*device = i;
|
*device = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user