aclrtMallocHost

Description

If your app runs on the host, this API is called to allocate the host memory, and the system guarantees that the start address of the memory is 64-byte aligned. If your app runs 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. This API is synchronous.

Restrictions

Prototype

aclError aclrtMallocHost(void **hostPtr, size_t size)

Parameters

Parameter

Input/Output

Description

size

Input

Requested allocation size in bytes.

Must not be 0.

hostPtr

Output

Pointer to allocated memory.

Returns

0 on success; else, failure.

See Also

For the API call example, see Data Transfer.