Function: mem_export_to_shareable_handle
C Prototype |
aclError aclrtMemExportToShareableHandle(aclrtDrvMemHandle handle, aclrtMemHandleType handleType, uint64_t flags, uint64_t *shareableHandle) |
|---|---|
Python Function |
shareable_handle, ret = acl.rt.mem_export_to_shareable_handle(handle, handle_type, flags) |
Function Usage |
Export the handle of the physical memory obtained by the current process through the acl.rt.malloc_physical API so that the physical memory can be shared with other processes. This API must be used together with the following APIs to implement memory sharing. The following uses processes A and B as an example to describe the process of calling the physical memory sharing API between two processes.
|
Input Description |
handle: int, handle for storing physical memory information. You need to call acl.rt.malloc_physical in this process to allocate physical memory. If this API is successfully called, a handle is returned. handle_type: int, reserved parameter. The value is fixed to ACL_MEM_HANDLE_TYPE_NONE = 0. flags: int, reserved parameter. The value is fixed to 0. |
Return Value |
shareable_handle: int, shareable_handle shared with other processes. ret: int, error code.
|
Restrictions |
|