dsmi_get_device_voltage
Prototype
int dsmi_get_device_voltage(int device_id, unsigned int *pvoltage)
Description
Obtains the the Ascend AI Processor voltage.
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. |
pvoltage |
Output |
Voltage (V). The precision is 0.01 V. A 16-bit unsigned short integer, in little endian mode. Calculated as: Voltage = pvoltage x 0.01. |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
None
Example
int ret = 0; unsigned int voltage; ret = dsmi_get_device_voltage(0, &voltage); if(ret != 0) { //To-do: records logs. return ret; } ...