将虚拟内存映射到物理内存。
Ascend RC形态不支持调用本接口。
aclError aclrtMapMem(void *virPtr, size_t size, size_t offset, aclrtDrvMemHandle handle, uint64_t flags)
参数名 |
输入/输出 |
说明 |
---|---|---|
virPtr |
输入 |
待映射的虚拟内存地址指针。 这个地址不一定是起始地址,用户也可以根据起始地址自行偏移后,再映射。 虚拟内存地址当前需按照2M对齐。 |
size |
输入 |
待映射的内存大小,单位Byte。 size当前需按照2M对齐。 |
offset |
输入 |
物理内存偏移值,当前只能设置为0。 |
handle |
输入 |
物理内存信息handle。 |
flags |
输入 |
预留,当前只能设置为0。 |
返回0表示成功,返回其它值表示失败。