aclrtMallocHostWithCfg
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Allocates the host memory (lock page memory). The system ensures that the start address of the memory is 64-byte aligned.
Compared with aclrtMallocHost, this API can also specify memory configuration when allocating memory.
The memory allocated by this API must be freed by calling aclrtFreeHost or aclrtFreeHostWithDevSync.
For the
Prototype
1 | aclError aclrtMallocHostWithCfg(void **ptr, uint64_t size, aclrtMallocConfig *cfg) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
ptr |
Output |
Pointer to the allocated memory. |
size |
Input |
Allocated memory size, in bytes. The size cannot be 0. |
cfg |
Input |
Memory configuration. For the type definition, see aclrtMallocConfig. If it is not specified, NULL can be passed. |
Returns
0 on success; otherwise, failure. For details, see aclError.