Function: free_physical

Applicability

Product

Supported (√/x)

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

Function Usage

Frees the physical memory allocated by the acl.rt.malloc_physical call.

Prototype

  • C Prototype
    1
    aclError aclrtFreePhysical(aclrtDrvMemHandle handle)
    
  • Python Function
    1
    ret = acl.rt.free_physical(handle)
    

Parameter Description

Parameter

Description

handle

Int, handle of the physical address to be freed.

Return Value Description

Return Value

Description

ret

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

Restrictions

  • This API is not supported in the Ascend RC form.
  • If the physical memory is mapped to virtual memory, you need to unmap them by calling acl.rt.unmap_mem before freeing the physical memory.