Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
当前 Runtime 指针属性查询链路未完整支持 aclrtHostRegister 场景下的用户 Host 内存识别。
aclrtHostRegister
在用户自行申请 Host 内存后执行 aclrtHostRegister,驱动 drvMemGetAttribute 会返回新的 memType:DV_MEM_USER_REGISTER。 Runtime 对该类型进行适配 aclrtPointerGetAttributes 相关查询结果适配
drvMemGetAttribute
memType
DV_MEM_USER_REGISTER
aclrtPointerGetAttributes
受影响的查询路径包括:
PointerGetAttributes
PtrGetAttributes
PtrGetRealLocation
规划
支持更多内存属性查询
在 include/driver/ascend_hal_base.h 中新增:
include/driver/ascend_hal_base.h
DV_MEM_USER_REGISTER = 0x0100
并补充语义说明:
halHostRegister
在 src/runtime/driver/npu_driver_mem.cc 中补充以下映射:
src/runtime/driver/npu_driver_mem.cc
DV_MEM_USER_REGISTER -> RT_MEMORY_TYPE_USER + RT_MEMORY_LOC_HOST
DV_MEM_USER_REGISTER -> RT_MEMORY_LOC_HOST
DV_MEM_USER_REGISTER -> location=HOST, realLocation=HOST
在 Runtime UT 中新增 DV_MEM_USER_REGISTER 场景覆盖:
同时补充 drvMemGetAttribute stub,模拟驱动返回 DV_MEM_USER_REGISTER。
/assign
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
当前 Runtime 指针属性查询链路未完整支持
aclrtHostRegister场景下的用户 Host 内存识别。在用户自行申请 Host 内存后执行
aclrtHostRegister,驱动drvMemGetAttribute会返回新的memType:DV_MEM_USER_REGISTER。 Runtime 对该类型进行适配aclrtPointerGetAttributes相关查询结果适配受影响的查询路径包括:
PointerGetAttributesPtrGetAttributesPtrGetRealLocationOrigin(信息来源)
规划
Benefit / Necessity (价值/作用)
支持更多内存属性查询
Design(设计方案)
1. 新增驱动内存类型定义
在
include/driver/ascend_hal_base.h中新增:DV_MEM_USER_REGISTER = 0x0100并补充语义说明:
halHostRegister注册后对应的内存类型2. 补齐 Runtime 查询映射
在
src/runtime/driver/npu_driver_mem.cc中补充以下映射:PointerGetAttributesDV_MEM_USER_REGISTER -> RT_MEMORY_TYPE_USER + RT_MEMORY_LOC_HOSTPtrGetAttributesDV_MEM_USER_REGISTER -> RT_MEMORY_LOC_HOSTPtrGetRealLocationDV_MEM_USER_REGISTER -> location=HOST, realLocation=HOST3. 补充 UT 覆盖
在 Runtime UT 中新增
DV_MEM_USER_REGISTER场景覆盖:PointerGetAttributesPtrGetAttributesPtrGetRealLocation同时补充
drvMemGetAttributestub,模拟驱动返回DV_MEM_USER_REGISTER。