Mapped hipDevice_t to int

Change-Id: I6cfa56c42b7cd04aa0e0bce510c0d72d34ea211a
此提交包含在:
Rahul Garg
2016-12-17 16:53:03 +05:30
父節點 2665ad2762
當前提交 263a9614ff
共有 4 個檔案被更改,包括 20 行新增41 行删除
+8 -22
查看文件
@@ -321,9 +321,8 @@ hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device
{
HIP_INIT_API(major,minor, device);
hipError_t e = hipSuccess;
int deviceId= device->_deviceId;
e = ihipDeviceGetAttribute(major, hipDeviceAttributeComputeCapabilityMajor, deviceId);
e = ihipDeviceGetAttribute(minor, hipDeviceAttributeComputeCapabilityMinor, deviceId);
e = ihipDeviceGetAttribute(major, hipDeviceAttributeComputeCapabilityMajor, device);
e = ihipDeviceGetAttribute(minor, hipDeviceAttributeComputeCapabilityMinor, device);
return ihipLogStatus(e);
}
@@ -331,28 +330,13 @@ hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device)
{
HIP_INIT_API(name,len, device);
hipError_t e = hipSuccess;
int nameLen = strlen(device->_props.name);
auto deviceHandle = ihipGetDevice(device);
int nameLen = strlen(deviceHandle->_props.name);
if(nameLen <= len)
memcpy(name,device->_props.name,nameLen);
memcpy(name,deviceHandle->_props.name,nameLen);
return ihipLogStatus(e);
}
#ifdef __cplusplus
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);
}
#endif
hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len, int device)
{
HIP_INIT_API(pciBusId, len, device);
@@ -365,11 +349,13 @@ hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len, int device)
}
return ihipLogStatus(e);
}
hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device)
{
HIP_INIT_API(bytes, device);
hipError_t e = hipSuccess;
*bytes= device->_props.totalGlobalMem;
auto deviceHandle = ihipGetDevice(device);
*bytes= deviceHandle->_props.totalGlobalMem;
return ihipLogStatus(e);
}