diff --git a/tests/src/hipEnvVar.cpp b/tests/src/hipEnvVar.cpp index d5942518e0..ff68103816 100644 --- a/tests/src/hipEnvVar.cpp +++ b/tests/src/hipEnvVar.cpp @@ -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< devPCINum; + char pciBusID[100]; //collect the device pci bus ID for all devices int totalDeviceNum = getDeviceNumber(); std::cout << "The total number of available devices is " << totalDeviceNum<< std::endl <<"Valid index range is 0 - "< devPCINum; for (int i = 0; i < totalDeviceNum ; i++) { - devPCINum.push_back(getDevicePCIBusNum(i)); + getDevicePCIBusNum(i, pciBusID); + devPCINum.push_back(pciBusID); std::cout <<"The collected device PCI Bus ID of Device "<