dsmi_get_device_utilization_rate
Prototype
int dsmi_get_device_utilization_rate(int device_id, int device_type, unsigned int *putilization_rate)
Description
Obtains the the Ascend AI Processor utilization.
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. |
device_type |
Input |
Device type Ascend 310 AI Processor supports 1, 2, 3, 4 and 5.
|
putilization_rate |
Output |
Utilization (%) |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
None
Example
int ret = 0; unsigned int putilization_rate; ret = dsmi_get_device_utilization_rate(0, 1, &putilization_rate); if(ret != 0) { //To-do: records logs. return ret; } ...