当前位置: 首页 > news >正文

CANN/asc-devkit: Reg矢量存储对齐接口

asc_storealign

【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言,原生支持C和C++标准规范,主要由类库和语言扩展层构成,提供多层级API,满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit

产品支持情况

产品是否支持
Ascend 950PR/Ascend 950DT

功能说明

reg计算数据搬运接口,适用于从矢量数据寄存器连续对齐搬出到UB的场景,接口使用repeat stride模式。

函数原型

// repeat stride模式搬出 __simd_callee__ inline void asc_storealign(__ubuf__ int8_t* dst_align32b, vector_int8_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ uint8_t* dst_align32b, vector_uint8_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ fp8_e5m2_t* dst_align32b, vector_fp8_e5m2_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ fp8_e4m3fn_t* dst_align32b, vector_fp8_e4m3fn_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ hifloat8_t* dst_align32b, vector_hifloat8_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ fp8_e8m0_t* dst_align32b, vector_fp8_e8m0_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ int16_t* dst_align32b, vector_int16_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ uint16_t* dst_align32b, vector_uint16_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ half* dst_align32b, vector_half src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ bfloat16_t* dst_align32b, vector_bfloat16_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ int32_t* dst_align32b, vector_int32_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ uint32_t* dst_align32b, vector_uint32_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign(__ubuf__ float* dst_align32b, vector_float src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) // repeat stride模式搬出,同时开启硬件自动Post Update模式 __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ int8_t* dst_align32b, vector_int8_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ uint8_t* dst_align32b, vector_uint8_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ fp8_e5m2_t* dst_align32b, vector_fp8_e5m2_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ fp8_e4m3fn_t* dst_align32b, vector_fp8_e4m3fn_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ hifloat8_t* dst_align32b, vector_hifloat8_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ fp8_e8m0_t* dst_align32b, vector_fp8_e8m0_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ int16_t* dst_align32b, vector_int16_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ uint16_t* dst_align32b, vector_uint16_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ half* dst_align32b, vector_half src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ bfloat16_t* dst_align32b, vector_bfloat16_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ int32_t* dst_align32b, vector_int32_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ uint32_t* dst_align32b, vector_uint32_t src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_storealign_postupdate(__ubuf__ float* dst_align32b, vector_float src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask)

参数说明

参数名输入/输出描述
dst_align32b输出目的操作数(矢量)的起始地址。
src输入源操作数(矢量数据寄存器)。
block_stride输入源操作数单次迭代内不同DataBlock间地址步长。
repeat_stride输入源操作数相邻迭代间相同DataBlock的地址步长。
mask输入源操作数掩码(掩码寄存器),用于指示在计算过程中哪些元素参与计算。对应位置为1时参与计算,为0时不参与计算。mask未筛选的元素在输出中置零。

矢量数据寄存器和掩码寄存器的详细说明请参见reg数据类型定义.md。

返回值说明

流水类型

PIPE_V

约束说明

调用示例

// asc_storealign __ubuf__ int8_t* dst_align32b; vector_int8_t src; uint16_t block_stride; uint16_t repeat_stride; vector_bool mask = asc_create_mask_b8(PAT_ALL); asc_storealign(dst_align32b, src, block_stride, repeat_stride, mask); // asc_storealign_postupdate __ubuf__ int8_t* dst_align32b; vector_int8_t src; uint16_t block_stride; uint16_t repeat_stride; vector_bool mask = asc_create_mask_b8(PAT_ALL); asc_storealign_postupdate(dst_align32b, src, block_stride, repeat_stride, mask);

【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言,原生支持C和C++标准规范,主要由类库和语言扩展层构成,提供多层级API,满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

http://www.cnnetsun.cn/news/2761627.html

相关文章:

  • 猫抓插件:重新定义网页资源获取体验的浏览器扩展
  • arabic_PP-OCRv5_mobile_rec_onnx社区贡献指南:如何参与项目开发和改进
  • 终极指南:forex-eurusd-direction与其他汇率预测模型的对比分析
  • 【Java基础知识 2】开发环境配置及idea的下载配置
  • 【Java基础知识 3】程序猿的第一段代码-HelloWorld
  • GSEA结果图总调不好看?手把手教你用R的enrichplot包定制专属富集分析图(配色、布局、标签详解)
  • 免费获得苹果苹方字体的终极指南:3分钟在Windows上安装专业中文字体
  • 生产级机器学习系统设计:从模型部署到可信决策的四大防线
  • HsMod终极指南:55项功能深度解析与配置教程
  • XAI实战三剑客:SHAP、Captum与DICE在金融、医疗、自动驾驶中的落地
  • QLoRA微调BERT实战:4-bit量化与低秩适配双技术融合指南
  • AnythingLLM私有知识库解决方案实战指南:从本地部署到企业级应用深度解析
  • LaTeX零基础入门指南:借助快马AI生成可运行代码边学边练
  • requests库的HTTPS连接池报错深度解析:从urllib3源码到生产环境最佳实践
  • 手把手教你用Python+MySQL搭建个人足球数据看板(附worldliveball核心思路)
  • 5分钟快速掌握163MusicLyrics:免费音乐歌词下载终极方案
  • 5分钟极速导出:YaeAchievement原神成就数据终极免费解决方案
  • 告别数据焦虑:用mootdx构建你的量化交易数据基础设施
  • 保姆级教程:用Fiddler Everywhere和夜神模拟器9抓取安卓APP的HTTPS请求(附证书安装避坑指南)
  • E5-small未来展望:文本嵌入技术的发展趋势和路线图
  • 影刀RPA店群自动化教程:Python协同浏览器请求拦截与智能Mock实战
  • 运放反相端那个‘多余’的电容,是怎么让你的电路崩溃的?——深入拆解反馈环路中的隐性极点
  • Oops Framework-4-Oops Framework入口类Root.ts
  • OBS Browser插件:5分钟完成OBS网页集成的终极指南
  • BFS-Best-Face-Swap高级技巧:利用LoRA技术提升换脸效果与效率
  • 模板驱动型文档自动化:让内容生产从手工缝制升级为工业流水线
  • 基于STC89C52的WIFI遥控四足蜘蛛机器人开发套件(含APP、ESP8266固件、Altium图纸与12路舵机控制代码)
  • Python 3 文件操作指南
  • 告别卡顿!用H265的Tile和Slice优化你的视频流传输(附带宽节省实测)
  • AutoGen本地部署避坑指南:Poetry+Ollama+Chroma全链路实操