Skip to content

GetCurAddr

产品支持情况​

  • Ascend 950PR&950DT系列产品:支持
  • Atlas A3系列产品:支持
  • Atlas A2系列产品:支持
  • Atlas 200I/500 A2推理产品:不支持
  • Atlas推理系列产品AI Core:支持
  • Atlas推理系列产品Vector Core:支持
  • Atlas训练系列产品:不支持

功能说明​

头文件路径为:"basic_api/kernel_tensor.h"。

返回当前物理位置空闲的起始地址。

函数原型​

C++
template <Hardware hard>
__aicore__ inline uint32_t LocalMemAllocator<hard>::GetCurAddr() const

参数说明​

无

返回值说明​

当前物理位置空闲的起始地址,范围为[0,物理内存最大值)。

约束说明​

无

调用示例​

C++
LocalMemAllocator allocator;
// 默认的物理位置为Unified Buffer(UB),由于从0地址开始分配,下面的打印结果为0
AscendC::printf("current addr is %u\n", allocator.GetCurAddr());

免责声明:本站内容由 asc-devkit 仓 master 分支自动编译生成,属于持续开发版本,可能存在缺陷,仅供预览与参考。如需稳定及商用资料,请查阅官方 昇腾社区。