news 2026/6/19 7:08:32

CANN/asc-devkit对齐数据搬运接口文档

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/asc-devkit对齐数据搬运接口文档

asc_loadalign

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

产品支持情况

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

功能说明

对齐数据搬运接口,从UB连续对齐搬入目的操作数,支持多种搬入模式,接口使用repeat stride模式。

函数原型

// repeat stride模式搬出 __simd_callee__ inline void asc_loadalign(vector_int8_t& dst, __ubuf__ int8_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_uint8_t& dst, __ubuf__ uint8_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_int16_t& dst, __ubuf__ int16_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_uint16_t& dst, __ubuf__ uint16_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_int32_t& dst, __ubuf__ int32_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_uint32_t& dst, __ubuf__ uint32_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_int64_t& dst, __ubuf__ int64_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_bfloat16_t& dst, __ubuf__ bfloat16_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_fp8_e4m3fn_t& dst, __ubuf__ fp8_e4m3fn_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_fp8_e5m2_t& dst, __ubuf__ fp8_e5m2_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_fp8_e8m0_t& dst, __ubuf__ fp8_e8m0_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_fp4x2_e1m2_t& dst, __ubuf__ fp4x2_e1m2_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_fp4x2_e2m1_t& dst, __ubuf__ fp4x2_e2m1_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_hifloat8_t& dst, __ubuf__ hifloat8_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_half& dst, __ubuf__ half* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_float& dst, __ubuf__ float* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign(vector_int4x2_t& dst, __ubuf__ int4b_t* src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) // repeat stride模式搬出,同时开启硬件自动Post Update模式 __simd_callee__ inline void asc_loadalign_postupdate(vector_int8_t& dst, __ubuf__ int8_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_uint8_t& dst, __ubuf__ uint8_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_int16_t& dst, __ubuf__ int16_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_uint16_t& dst, __ubuf__ uint16_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_int32_t& dst, __ubuf__ int32_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_uint32_t& dst, __ubuf__ uint32_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_int64_t& dst, __ubuf__ int64_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_bfloat16_t& dst, __ubuf__ bfloat16_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_fp8_e4m3fn_t& dst, __ubuf__ fp8_e4m3fn_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_fp8_e5m2_t& dst, __ubuf__ fp8_e5m2_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_fp8_e8m0_t& dst, __ubuf__ fp8_e8m0_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_fp4x2_e1m2_t& dst, __ubuf__ fp4x2_e1m2_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_fp4x2_e2m1_t& dst, __ubuf__ fp4x2_e2m1_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_hifloat8_t& dst, __ubuf__ hifloat8_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_half& dst, __ubuf__ half*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_float& dst, __ubuf__ float*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask) __simd_callee__ inline void asc_loadalign_postupdate(vector_int4x2_t& dst, __ubuf__ int4b_t*& src, uint16_t block_stride, uint16_t repeat_stride, vector_bool mask)

参数说明

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

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

返回值说明

流水类型

PIPE_V

约束说明

调用示例

// asc_loadalign __ubuf__ int8_t* src; vector_int8_t dst; uint16_t block_stride; uint16_t repeat_stride; vector_bool mask = asc_create_mask_b8(PAT_ALL); asc_loadalign(dst, src, block_stride, repeat_stride, mask); // asc_loadalign_postupdate __ubuf__ int8_t* src; vector_int8_t dst; uint16_t block_stride; uint16_t repeat_stride; vector_bool mask = asc_create_mask_b8(PAT_ALL); asc_loadalign_postupdate(dst, src, block_stride, repeat_stride, mask);

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

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

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/19 7:04:51

深入解析MPC857T指令集:有效地址、内存同步与原子操作实践

1. 项目概述与核心价值在嵌入式系统开发,尤其是网络通信、工业控制和汽车电子这些对实时性和可靠性要求极高的领域,处理器的指令集就像是工程师手中的“武功秘籍”。它不仅仅是CPU能听懂的命令列表,更是决定了系统性能上限、代码密度和开发效…

作者头像 李华
网站建设 2026/6/19 7:03:51

2026年6月18日每日60秒读懂世界

🔥 个人主页: 杨利杰YJlio ❄️ 个人专栏: 《Windows 疑难杂症与工单复盘案例库》 《Sysinternals实战教程》 《WINDOWS教程》 《Windows PowerShell 实战》 《IOS插件分析测试》 《超简单:用Python让Excel飞起来》…

作者头像 李华
网站建设 2026/6/19 6:49:48

深入解析MMCCMB2102开发板引脚交叉参考表:从硬件连接到FPGA设计实践

1. 项目概述与核心价值 在嵌入式硬件开发,尤其是涉及多FPGA或处理器与FPGA协同工作的复杂系统中,最让人头疼的往往不是算法逻辑,而是那一堆密密麻麻的引脚定义和它们之间错综复杂的连接关系。你手头可能有一份原理图、一份芯片手册&#xff0…

作者头像 李华
网站建设 2026/6/19 6:46:05

CGCNN数据集制作全攻略:CIF文件与id_prop.csv格式详解

CGCNN数据集制作全攻略:CIF文件与id_prop.csv格式详解 【免费下载链接】cgcnn Crystal graph convolutional neural networks for predicting material properties. 项目地址: https://gitcode.com/gh_mirrors/cg/cgcnn 想要使用CGCNN(Crystal Gr…

作者头像 李华
网站建设 2026/6/19 6:43:15

Narou.rb:日本网络小说下载与管理的终极解决方案

Narou.rb:日本网络小说下载与管理的终极解决方案 【免费下载链接】narou Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理アプリ。Kindle(などの電子書籍端末)でなろうを読む場合に超便利です! …

作者头像 李华
网站建设 2026/6/19 6:43:03

MGT5100时序与电气规格解析:硬件稳定性的设计基石

1. 项目概述与核心价值在嵌入式硬件开发领域,尤其是涉及复杂系统级芯片(SoC)或通信处理器时,最让工程师头疼的往往不是算法逻辑,而是那些密密麻麻的时序图和电气参数表。我见过太多项目,软件跑得飞起&#…

作者头像 李华