Added hipDeviceComputeCapability, hipDeviceGetPCIBusId and hipDeviceGetName

Change-Id: Ibe2d975df796712633900ddc7b0734ec2b8ab4ec
This commit is contained in:
Rahul Garg
2016-09-02 14:45:53 +05:30
parent 2b2ffaf599
commit 392860bf20
3 ha cambiato i file con 74 aggiunte e 0 eliminazioni
+30
Vedi File
@@ -324,3 +324,33 @@ hipError_t hipDeviceGetFromId(hipDevice_t *device, int deviceId)
return ihipLogStatus(e);
}
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 = hipDeviceGetAttribute(major, hipDeviceAttributeComputeCapabilityMajor, deviceId);
e = hipDeviceGetAttribute(minor, hipDeviceAttributeComputeCapabilityMinor, deviceId);
return ihipLogStatus(e);
}
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);
if(nameLen <= len)
memcpy(name,device->_props.name,nameLen);
return ihipLogStatus(e);
}
hipError_t hipDeviceGetPCIBusId (int *pciBusId,int len,hipDevice_t device)
{
HIP_INIT_API(pciBusId,len, device);
hipError_t e = hipSuccess;
int deviceId= device->_deviceId;
e = hipDeviceGetAttribute(pciBusId, hipDeviceAttributePciBusId, deviceId);
return ihipLogStatus(e);
}