Changed hipDeviceGetPCIBusId to return Bus ID as string

Change-Id: I6d5aa7362084109d34bc015d948f8723b2a38ee9
This commit is contained in:
Rahul Garg
2016-12-06 16:55:17 +05:30
parent b8413a69c8
commit 0017419521
+6 -1
View File
@@ -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);
}