aclrtGetDeviceUtilizationRate

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

Queries the utilization of the Cube, Vector, AI CPU, and other components on a device.

Prototype

1
aclError aclrtGetDeviceUtilizationRate(int32_t deviceId, aclrtUtilizationInfo *utilizationInfo)

Parameters

Parameter

Input/Output

Description

deviceId

Input

Device ID.

The value must be in the range of [0, (Available device count – 1)]. Call aclrtGetDeviceCount to obtain the device count.

utilizationInfo

Output

Pointer to the utilization information structure. For details about the type definition, see aclrtUtilizationInfo.

Returns

0 on success; otherwise, failure. For details, see aclError.

Restrictions

  • When this API is used to query the vector utilization, if the query result is –1, it indicates that the vector does not exist.
  • The current version does not support querying device memory utilization. If this API is used to query the memory utilization, the returned value is –1.
  • When profiling is enabled, this API cannot be called to query the utilization, and the returned value has no meaning.
  • For the Ascend virtual instance, this API cannot be called to query the utilization, and the returned value has no meaning.