Added hipDeviceTotalMem
Change-Id: I877fbc9e4767bbd70ecd0184f5123c9bc6cbd06f
This commit is contained in:
@@ -1274,6 +1274,15 @@ hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device);
|
|||||||
*/
|
*/
|
||||||
hipError_t hipDeviceGetPCIBusId (int *pciBusId,int len,hipDevice_t device);
|
hipError_t hipDeviceGetPCIBusId (int *pciBusId,int len,hipDevice_t device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the total amount of memory on the device.
|
||||||
|
* @param [out] bytes
|
||||||
|
* @param [in] device
|
||||||
|
*
|
||||||
|
* @returns #hipSuccess, #hipErrorInavlidDevice
|
||||||
|
*/
|
||||||
|
hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the approximate HIP driver version.
|
* @brief Returns the approximate HIP driver version.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -645,6 +645,11 @@ inline static hipError_t hipDeviceGetPCIBusId (int *pciBusId,int len,hipDevice_t
|
|||||||
return hipCUResultTohipError(cuDeviceGetPCIBusId((char*)pciBusId,len,device));
|
return hipCUResultTohipError(cuDeviceGetPCIBusId((char*)pciBusId,len,device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device)
|
||||||
|
{
|
||||||
|
return hipCUResultTohipError(cuDeviceTotalMem(bytes,device));
|
||||||
|
}
|
||||||
|
|
||||||
inline static hipError_t hipModuleLoad(hipModule_t *module, const char* fname)
|
inline static hipError_t hipModuleLoad(hipModule_t *module, const char* fname)
|
||||||
{
|
{
|
||||||
return hipCUResultTohipError(cuModuleLoad(module, fname));
|
return hipCUResultTohipError(cuModuleLoad(module, fname));
|
||||||
|
|||||||
@@ -354,3 +354,10 @@ hipError_t hipDeviceGetPCIBusId (int *pciBusId,int len,hipDevice_t device)
|
|||||||
return ihipLogStatus(e);
|
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;
|
||||||
|
return ihipLogStatus(e);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user