aclrtMemManagedGetAttr

须知:本接口为预留接口,暂不支持。

功能说明

查询指定大小的UVM内存的策略属性值。

本接口操作的内存必须是通过aclrtMemAllocManaged接口分配的。若查询的这段内存范围内的策略属性值不一致,则查询结果为无效值。

与aclrtMemManagedGetAttrs接口不同,本接口仅支持一次查询一个内存策略属性的值。

函数原型

1
aclError aclrtMemManagedGetAttr(aclrtMemManagedRangeAttribute attribute, const void *ptr, size_t size, void *data, size_t dataSize)

参数说明

参数名

输入/输出

说明

attribute

输入

待查询的属性。类型定义请参见aclrtMemManagedRangeAttribute。

ptr

输入

待查询属性的内存首地址,范围必须在UVM内存范围之内,即[0x90000000000ULL, 0x90000000000ULL+3TB)。

size

输入

待查询属性的内存大小,单位Byte。取值范围为(0, 3TB]。

data

输出

查询结果。

dataSize

输入

存放查询结果的内存大小,单位Byte。

返回值说明

返回0表示成功,返回其他值表示失败,请参见aclError。