Function: free_host

C Prototype

aclError aclrtFreeHost(void *hostPtr)

Python Function

ret= acl.rt.free_host(host_ptr)

Function Usage

Frees host memory.

Input Description

host_ptr: int, pointer address of the memory to be freed.

Return Value

ret: int, error code.

Restrictions

  • This API immediately releases 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.
  • acl.rt.free_host can only free the memory allocated by acl.rt.malloc_host.

Reference

For details about the API call example, see Data Copy.