尧图网络科技YAOTU DIGITAL 获取报价
获取报价
首页 / 资讯中心 / 文章详情

CANN/asc-devkit LocalMemAllocator简介

发布时间:2026/9/21 4:10:45

资讯中心
01
ARTICLE

CANN/asc-devkit LocalMemAllocator简介

CANN/asc-devkit LocalMemAllocator简介
LocalMemAllocator简介【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkitLocalMemAllocator是在使用静态Tensor编程时用于内存管理的类用户无需构建TPipe/TQue而是直接创建LocalTensor对象也可以直接通过LocalTensor构造函数进行构造并开发算子从而减少运行时的开销实现更优的性能。LocalMemAllocator仅支持在Ascend C静态Tensor编程方式中使用不可以与TPipe等接口混用。需要包含的头文件#include kernel_operator.h原型定义templateHardware hard Hardware::UB class LocalMemAllocator { public: __aicore__ inline LocalMemAllocator(); __aicore__ inline uint32_t GetCurAddr() const; template class DataType, uint32_t tileSize LocalTensorDataType __aicore__ inline Alloc(); template TPosition pos, class DataType, uint32_t tileSize __aicore__ inline LocalTensorDataType Alloc(); template class DataType LocalTensorDataType __aicore__ inline Alloc(uint32_t tileSize); template TPosition pos, class DataType LocalTensorDataType __aicore__ inline Alloc(uint32_t tileSize); template class DataType LocalTensorDataType __aicore__ inline Alloc(); };模板参数表1模板参数说明参数名描述hard用于表示数据的物理位置Hardware枚举类型定义如下合法位置为UB、L1、L0A、L0B、L0C、BIAS、FIXBUF。enum class Hardware : uint8_t { GM, // Global Memory UB, // Unified Buffer L1, // L1 Buffer L0A, // L0A Buffer L0B, // L0B Buffer L0C, // L0C Buffer BIAS, // BiasTable Buffer FIXBUF, // Fixpipe Buffer MAX };【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
02
RELATED NEWS

相关资讯

更多网站建设与数字化升级内容

03
WHY YAOTU

想打造同款高转化官网?

懂行业、懂生意,从建站到增长一站式陪跑

场景化定制

不做模板站,围绕你的业务场景量身设计,小众不撞款。

营销型架构

以转化目标组织内容与路径,让官网真正带来询盘。

全周期服务

设计、开发、运营、运维一体,上线只是开始。

免费获取你的建站方案

留下需求,专属顾问 24 小时内为你输出方案建议。