Function: malloc_host
|
C Prototype |
aclError aclrtMallocHost(void **hostPtr, size_t size) |
|---|---|
|
Python Function |
host_ptr, ret= acl.rt.malloc_host(size) |
|
Function Usage |
When the pyACL application is running on the host, this API allocates the host memory (lock page memory). The system ensures that the start address of the memory is 64-byte aligned. If the pyACL application is running on the device, this API is called to allocate the device memory by normal page. If 64-byte alignment is required for the start address, you need to guarantee the alignment. |
|
Input Description |
size: int, size of the allocated memory, in bytes. The size cannot be 0. |
|
Return Value |
host_ptr: int, address of the pointer that has been allocated with memory on the host. ret: int, error code.
|
|
Restrictions |
|
|
Reference |