Function: map_mem
C Prototype |
aclError aclrtMapMem(void *virPtr, size_t size, size_t offset, aclrtDrvMemHandle handle, uint64_t flags) |
|---|---|
Python Function |
ret = acl.rt.map_mem(vir_ptr, size, offset, handle, flags) |
Function Usage |
Maps virtual memory to physical memory. This API needs to work with other APIs to allocate virtual memory with consecutive addresses and maximize the use of physical memory.
|
Input Description |
vir_ptr: int, virtual address to be mapped. The address may not be the start address. You can also offset the address based on the start address and then map the address. The virtual address must be 2-MB aligned. size: indicates the size of the memory to be mapped, in bytes. Its value is an integer. The size must be 2-MB aligned. offset: offset of the physical memory. This parameter can only be set to 0. handle: address of the physical memory pointer. flags: reserved. This parameter can only be set to 0. |
Return Value |
ret: int, error code.
|
Restrictions |
This API is not supported in Ascend RC form. |