Function: malloc_host_with_cfg
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Allocates host memory (page-locked memory). The system ensures that the start address of the memory is 64-byte aligned. Compared with the acl.rt.malloc_host API, this API can specify memory-related configuration information when allocating memory.
Prototype
- C Prototype
1aclError aclrtMallocHostWithCfg(void **ptr, uint64_t size, aclrtMallocConfig *cfg)
- Python Function
1host_ptr, ret= acl.rt.malloc_host_with_cfg(size, cfg)
Parameter Description
Parameter |
Description |
|---|---|
size |
Int, allocated memory size, in bytes. Must not be 0. |
cfg |
Dict, memory configuration. If no configuration is specified, an empty dictionary is allowed. For details, see aclrtMallocConfig. |
Return Value Description
Return Value |
Description |
|---|---|
host_ptr |
Int, address of the pointer to the allocated host memory. |
ret |
Int, error code: 0 on success; else, failure. |