aclrtReleaseMemAddress

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

Frees the virtual memory allocated by the aclrtReserveMemAddress call.

This API must be used together with other APIs to allocate virtual memory with consecutive addresses and maximize the use of physical memory.
  1. Call aclrtReserveMemAddress to allocate virtual memory.
  2. Call aclrtMallocPhysical to allocate physical memory.
  3. Call aclrtMapMem to map virtual memory to physical memory.
  4. Call specific task APIs to execute tasks.
  5. Call aclrtUnmapMem to cancel the mapping between virtual memory and physical memory.
  6. Call aclrtFreePhysical to free physical memory.
  7. Call aclrtReleaseMemAddress to free virtual memory.

Prototype

1
aclError aclrtReleaseMemAddress(void *virPtr)

Parameters

Parameter

Input/Output

Description

virPtr

Input

Pointer to the address of the virtual memory to be freed.

Returns

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

Restrictions

  • Atlas 200I/500 A2 inference products in Ascend RC form: This API is not supported.
  • If the virtual memory is mapped to physical memory, you need to unmap them by calling aclrtUnmapMem before freeing the virtual memory.

API Call Example

For the API call example, see Virtual Memory Management.