aclrtReleaseMemAddress
Description
Frees the virtual memory allocated by the aclrtReserveMemAddress call.
This API needs to be used with other APIs to allocate virtual memory with consecutive addresses and maximize the use of physical memory.
- Call aclrtReserveMemAddress to allocate virtual memory.
- Call aclrtMallocPhysical to allocate physical memory.
- Call aclrtMapMem to map the virtual memory to the physical memory.
- Call specific task APIs to execute tasks.
- Call aclrtUnmapMem to unmap the virtual memory from the physical memory.
- Call aclrtFreePhysical to free the physical memory.
- Call aclrtReleaseMemAddress to free the virtual memory.
Restrictions
- This API is not supported in the Ascend RC form.
Currently, the following models support the Ascend RC form:
Atlas 200/300/500 Inference Product
- If the virtual memory is mapped to physical memory, you need to unmap them by calling aclrtUnmapMem before freeing the virtual memory.
Prototype
aclError aclrtReleaseMemAddress(void *virPtr)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
virPtr |
Input |
Pointer to the address of the virtual memory to be released. |
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.
Parent topic: Memory Management