From 014f1797d9dce095fc6a76f8bb920a94f0bb51de Mon Sep 17 00:00:00 2001 From: sunway513 Date: Thu, 27 Jul 2017 17:41:49 +0000 Subject: [PATCH] Change to use hipDeviceGetPCIBusId api for hipEnvVarDriver test [ROCm/hip commit: ed0d6cf7454d792d3d2edd7ac72dcee07b5dc974] --- projects/hip/tests/src/hipEnvVar.cpp | 15 ++++---- projects/hip/tests/src/hipEnvVarDriver.cpp | 42 +++++++++++----------- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/projects/hip/tests/src/hipEnvVar.cpp b/projects/hip/tests/src/hipEnvVar.cpp index d5942518e0..ff68103816 100644 --- a/projects/hip/tests/src/hipEnvVar.cpp +++ b/projects/hip/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 "<