C 接口将 aclrtPtrAttributes 的 rsv[4] 替换为 hostPtr 和 devicePtr。pyACL 的 GetPyDictFromPtrAttributes 仍访问 attributes.rsv,使用同版本的 C 头文件编译时会报成员不存在。
master
194a90393
include/external/acl/acl_rt.h
python/pyACL/rt/rt_memory.cpp
GetPyDictFromPtrAttributes
attributes.rsv
aclrtPtrAttributes
sizeof(attributes.rsv)
pyACL 可以使用同版本的 C 头文件编译。acl.rt.pointer_get_attributes(ptr) 返回 (attributes, ret),其中 attributes 包含 location、page_size、host_ptr 和 device_ptr。两个地址字段均为 Python int,C 空指针对应 0。
acl.rt.pointer_get_attributes(ptr)
(attributes, ret)
attributes
location
page_size
host_ptr
device_ptr
int
0
最小复现的 GCC 诊断
error: 'aclrtPtrAttributes' {aka 'struct aclrtPtrAttributes'} has no member named 'rsv'
同步更新 pyACL 中英文 aclrtPtrAttributes 文档,将字段名统一为 page_size,并说明 host_ptr 和 device_ptr 的返回值。
C 结构体变更 · pyACL 封装
/assign
你好,相关结构体pyacl适配pr已合入,感谢贡献!
Describe the current behavior / 问题描述 (Mandatory / 必填)
C 接口将 aclrtPtrAttributes 的 rsv[4] 替换为 hostPtr 和 devicePtr。pyACL 的 GetPyDictFromPtrAttributes 仍访问 attributes.rsv,使用同版本的 C 头文件编译时会报成员不存在。
Environment / 环境信息 (Mandatory / 必填)
master,提交194a90393。Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
194a90393,并使用同版本的include/external/acl/acl_rt.h。python/pyACL/rt/rt_memory.cpp,观察GetPyDictFromPtrAttributes中访问attributes.rsv时的编译错误。aclrtPtrAttributes实例求sizeof(attributes.rsv)的 C++ 代码,复现同一错误。Describe the expected behavior / 预期结果 (Mandatory / 必填)
pyACL 可以使用同版本的 C 头文件编译。
acl.rt.pointer_get_attributes(ptr)返回(attributes, ret),其中attributes包含location、page_size、host_ptr和device_ptr。两个地址字段均为 Pythonint,C 空指针对应0。Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
最小复现的 GCC 诊断
Special notes for this issue/备注 (Optional / 选填)
同步更新 pyACL 中英文
aclrtPtrAttributes文档,将字段名统一为page_size,并说明host_ptr和device_ptr的返回值。C 结构体变更 · pyACL 封装