Function: free_host

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Frees host memory.

Prototype

  • C Prototype

    aclError aclrtFreeHost(void *hostPtr)
    
  • Python Function

    ret = acl.rt.free_host(host_ptr)
    

Parameters

Parameter Description
host_ptr Int, pointer address of the memory to be freed.

Return Values

Return Value Description
ret Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails.

Constraints

  • This API immediately frees the input memory. No implicit device synchronization or stream synchronization is performed within the function. Ensure that the memory pointer address is not accessed after this API is called.
  • The acl.rt.free_host API can only free the memory allocated by the acl.rt.malloc_host API.