From 61dffc7e18442b8f56d86baeb9f12d1a43d91aa9 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Tue, 6 Dec 2016 16:55:17 +0530 Subject: [PATCH] Changed hipDeviceGetPCIBusId to return Bus ID as string Change-Id: I6d5aa7362084109d34bc015d948f8723b2a38ee9 [ROCm/hip commit: 27072b897210810d01534f06e8c5d9b0e15d099e] --- projects/hip/src/hip_device.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/hip/src/hip_device.cpp b/projects/hip/src/hip_device.cpp index bc8a2c297f..085314d461 100644 --- a/projects/hip/src/hip_device.cpp +++ b/projects/hip/src/hip_device.cpp @@ -342,7 +342,12 @@ hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len,hipDevice_t device) HIP_INIT_API(pciBusId, len, device); hipError_t e = hipSuccess; int deviceId= device->_deviceId; - e = ihipDeviceGetAttribute((int*)pciBusId, hipDeviceAttributePciBusId, deviceId); + int tempPciBusId = 0; + e = ihipDeviceGetAttribute( tempPciBusId, hipDeviceAttributePciBusId, deviceId); + if( e == hipSuccess) { + std::string tempPciStr = std::to_string(tempPciBusId); + memcpy( pciBusId , tempPciStr.c_str() , tempPciStr.length() ); + } return ihipLogStatus(e); }