aclrtGetDeviceUtilizationRate

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

Queries the usage of the Cube, Vector, and AI CPU on the device.

Prototype

1
aclError aclrtGetDeviceUtilizationRate(int32_t deviceId, aclrtUtilizationInfo *utilizationInfo)

Parameters

Parameter

Input/Output

Description

deviceId

Input

Device ID.

Must be in the range of [0, Device count – 1]. Call aclrtGetDeviceCount to obtain the device count.

utilizationInfo

Output

Pointer to the usage 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 usage, and the returned value has no meaning.
  • In the Ascend virtual instance scenario, this API cannot be called to query the usage, and the returned value has no meaning.