dsmi_get_device_power_info
Prototype
int dsmi_get_device_power_info(int device_id,struct dsmi_power_info_stru * pdevice_power_info)
Description
Obtains the rated power of a device.
For the Ascend 310 AI Processor, this API supports mini modules (EP) and standard PCIe cards.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
device_id |
Input |
Device ID For the Ascend 310 AI Processor, the value range is 0–63. Obtain the actual device ID by calling dsmi_list_device. |
pdevice_power_info |
Output |
Rated power (W). The precision is 0.1 W. A 16-bit unsigned short integer, in little endian mode. struct dsmi_power_info_stru { unsigned short power; }; |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
None
Example
int ret = 0; struct dsmi_power_info_stru powerinfo = {0}; ret = dsmi_get_device_power_info(0, &powerinfo); if(ret != 0) { //To-do: records logs. return ret; } ...