Function: get_mem_info

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Obtains the free and total memory sizes of an app with specified attributes, excluding the memory size reserved for the system.

Prototype

Parameters

Parameter

Input/Output

Description

attr

Input

Memory attribute value to be queried. The value is of the int type. For details, see aclrtMemAttr.

Return Values

Return Value

Description

free

Int, free memory size of the corresponding attribute, in bytes.

total

Int, total memory size of the corresponding attribute, in bytes.

ret

Int, error code. 0 on success; else, failure.

Restrictions