Function: unmap_mem

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

Unmaps virtual memory from physical memory.

This API needs to work with other APIs to allocate virtual memory with consecutive addresses and maximize the use of physical memory.
  1. Call acl.rt.reserve_mem_address to allocate virtual memory.
  2. Call acl.rt.malloc_physical to allocate physical memory.
  3. Call acl.rt.map_mem to map the virtual memory to the physical memory.
  4. Call specific task APIs to execute tasks.
  5. Call acl.rt.unmap_mem to unmap the virtual memory from the physical memory.
  6. Call acl.rt.free_physical to free the physical memory.
  7. Call acl.rt.release_mem_address to free the virtual memory.

Prototype

  • C Prototype
    1
    aclError aclrtUnmapMem(void *virPtr)
    
  • Python Function
    1
    ret = acl.rt.unmap_mem(vir_ptr)
    

Parameters

Parameter

Description

vir_ptr

Int, virtual address to be unmapped.

Return Value

Return Value

Description

ret

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

Restrictions

Ascend RC does not support this API.