函数:pointer_get_attributes
产品支持情况
产品 |
是否支持 |
---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
获取内存属性信息,包括内存是位于Host还是Device、页表大小等信息。
函数原型
- C函数原型
1
aclError aclrtPointerGetAttributes(const void *ptr, aclrtPtrAttributes *attributes)
- python函数
1
attributes, ret = acl.rt.pointer_get_attributes(ptr)
参数说明
参数名 |
说明 |
---|---|
ptr |
int,内存地址。此处仅支持通过pyacl接口申请的内存。 |
返回值说明
返回值 |
说明 |
---|---|
attributes |
dict,内存属性信息,具体请参见aclrtPtrAttributes。 |
ret |
int,错误码,返回0表示成功,返回其它值表示失败。 |
父主题: 内存管理