Function: free

C Prototype

aclError aclrtFree(void *devPtr)

Python Function

ret= acl.rt.free(dev_ptr)

Function Usage

Frees device memory.

Input Description

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

Return Value

ret: int, error code.

Restrictions

  • acl.rt.free frees device memory through the acl.rt.malloc or acl.rt.malloc_cached API.
  • This API immediately frees the input memory. No implicit device synchronization or stream synchronization is performed within the function. Ensure that the memory pointer is not accessed after this API is called.

Reference

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