Function: host_register_v2
Applicable Products
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
x |
|
x |
|
x |
Prototype
- C Prototype
1aclError aclrtHostRegisterV2(void *ptr, uint64_t size, uint32_t flag)
- Python Function
1ret = acl.rt.host_register_v2 (ptr, size, flag)
Parameters
Parameter |
Description |
|---|---|
ptr |
Host memory address. The host memory address must be 4K-page-aligned. If the OS kernel version is 5.10 or earlier, using non-page-locked memory will cause exceptions. Therefore, you must call aclrtMallocHost to allocate page-locked host memory. If the OS kernel version is later than 5.10, non-page-locked host memory can be used. Therefore, you can either call aclrtMallocHost to allocate page-locked host memory or call malloc to allocate non-page-locked host memory. |
size |
Buffer size in bytes. |
flag |
Memory registration type.
|
Return Values
Return Value |
Description |
|---|---|
ret |
Int, 0 on success; else failure. |
Constraints
For the