hipDeviceGetPCIBusId int version changes for CUDA runtime API
Change-Id: I4d3b995f1d1ac83415ca84808a074e5c8cd72f3c
[ROCm/hip commit: 266b27ac83]
This commit is contained in:
@@ -1622,7 +1622,7 @@ hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device);
|
||||
*
|
||||
* @returns #hipSuccess, #hipErrorInavlidDevice
|
||||
*/
|
||||
// hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len,hipDevice_t device);
|
||||
hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len,hipDevice_t device);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -770,9 +770,14 @@ inline static hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device)
|
||||
return hipCUResultTohipError(cuDeviceGetName(name,len,device));
|
||||
}
|
||||
|
||||
inline static hipError_t hipDeviceGetPCIBusId(char* pciBusId,int len,int device)
|
||||
{
|
||||
return hipCUDAErrorTohipError(cudaDeviceGetPCIBusId(pciBusId,len,device));
|
||||
}
|
||||
|
||||
inline static hipError_t hipDeviceGetPCIBusId(char* pciBusId,int len,hipDevice_t device)
|
||||
{
|
||||
return hipCUResultTohipError(cuDeviceGetPCIBusId((char*)pciBusId,len,device));
|
||||
return hipCUResultTohipError(cuDeviceGetPCIBusId(pciBusId,len,device));
|
||||
}
|
||||
|
||||
inline static hipError_t hipDeviceGetByPCIBusId(int* device, const int *pciBusId)
|
||||
|
||||
@@ -337,6 +337,20 @@ hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device)
|
||||
return ihipLogStatus(e);
|
||||
}
|
||||
|
||||
hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len,hipDevice_t device)
|
||||
{
|
||||
HIP_INIT_API(pciBusId, len, device);
|
||||
hipError_t e = hipSuccess;
|
||||
int deviceId= device->_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);
|
||||
}
|
||||
|
||||
hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len, int device)
|
||||
{
|
||||
HIP_INIT_API(pciBusId, len, device);
|
||||
|
||||
مرجع در شماره جدید
Block a user