Change to use hipDeviceGetPCIBusId api for hipEnvVarDriver test

This commit is contained in:
sunway513
2017-07-27 17:41:49 +00:00
parent 6f359dfbe6
commit ed0d6cf745
2 changed files with 27 additions and 30 deletions
+7 -8
View File
@@ -109,15 +109,14 @@ int main(int argc, char **argv)
std::cout << devCount << std::endl;
}
if (retDevInfo) {
hipSetDevice(device);
hipDeviceProp_t devProp;
hipDevice_t deviceT;
hipDeviceGet(&deviceT, device);
hipGetDeviceProperties(&devProp, device);
if (devProp.major < 1) {
printf("%d does not support HIP\n", device);
return -1;
}
std::cout << devProp.pciBusID << std::endl;
char pciBusId[100];
memset(pciBusId,0,100);
hipDeviceGetPCIBusId(pciBusId,100,deviceT);
cout<<pciBusId<<endl;
}
exit(0);
}