Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Obtains the free and total memory sizes of an app with specified attributes, excluding the memory size reserved for the system.
1 | aclError aclrtGetMemInfo(aclrtMemAttr attr, size_t *free, size_t *total) |
1 | free, total, ret = acl.rt.get_mem_info(attr) |
Parameter |
Input/Output |
Description |
|---|---|---|
attr |
Input |
Memory attribute value to be queried. The value is of the int type. For details, see aclrtMemAttr. |
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. |
Select the memory of a specified attribute based on hardware. Otherwise, the free memory size and total memory size output by this API call are both 0.
Select the memory of a specified attribute based on hardware. Otherwise, the free memory size and total memory size output by this API call are both 0.
If on-chip memory is queried, the system automatically queries the DDR memory because the device does not have on-chip memory. For example, the system queries ACL_DDR_MEM instead of ACL_HBM_MEM, and ACL_DDR_MEM_HUGE instead of ACL_HBM_MEM_HUGE.
If on-chip memory is queried, the system automatically queries the DDR memory because the device does not have on-chip memory. For example, the system queries ACL_DDR_MEM instead of ACL_HBM_MEM, and ACL_DDR_MEM_HUGE instead of ACL_HBM_MEM_HUGE.