dcmi_get_device_utilization_rate Prototype
Syntax
int dcmi_get_device_utilization_rate(int card_id, int device_id,int subdevice_type, unsigned int *putilization_rate)
Function
Queries the chip usage.
Parameter Description
Parameter |
Input/Output |
Type |
Description |
---|---|---|---|
card_id |
Input |
int |
ID of the Atlas 300T training card (model 9000). Query the supported IDs by referring to dcmi_get_card_num_list Prototype. |
device_id |
Input |
int |
Chip ID. The value is 0 (there is only one chip). Query the actually supported range by referring to dcmi_get_device_num_in_card Prototype. |
subdevice_type |
Input |
int |
Component type. The options are as follows: 1: memory 2: AI core 3: AI CPU 4: control CPU 5: memory bandwidth |
putilization_rate |
Output |
unsigned int * |
Ascend AI processor usage. The unit is %. |
Return Value
Type |
Description |
---|---|
int |
Results:
|
Exception Handling
N/A
Constraints
N/A
Calling Example
int ret = 0;
unsigned int putilization_rate;
int card_id = 0x56;
int device_id = 0;
ret = dcmi_get_device_utilization_rate(card_id, device_id, 1, &putilization_rate);
if(ret != 0) {
//todo: records logs
return ret;
}
...