Function: get_device_utilization_rate
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Queries the usage of the Cube, Vector, and AI CPU on the device.
Prototype
- C Prototype
1aclError aclrtGetDeviceUtilizationRate(int32_t deviceId, aclrtUtilizationInfo *utilizationInfo)
- Python Function
1utilization_info, ret = acl.rt.get_device_utilization_rate (device_id)
Parameter Description
Parameter |
Description |
|---|---|
device_id |
Int, device ID. Must be in the range of [0, Device count – 1]. Call acl.rt.get_device_count to obtain the device count. |
Return Value Description
Return Value |
Description |
|---|---|
utilization_info |
Dict, usage information dictionary of the aclrtUtilizationInfo type. For details, see aclrtUtilizationInfo. |
ret |
Int, error code: 0 on success; else, failure. |
Restrictions
- For Ascend virtual instances, this API cannot be called to query the usage, and the returned value has no meaning.
- When profiling is enabled, this API cannot be called to query the usage, and the returned value has no meaning.
- Querying the memory usage of a device is a reserved function and is not supported in the current version. If this API is called to query the memory usage, the returned value is -1.
- There is no vector on the
Atlas training products . When this API is called to query the vector usage, the returned value is -1.
Parent topic: Device Management