尧图网络 高端网站定制 · 原创设计
免费咨询热线
400-888-6620
免费获取方案
CANN/asc-devkit:SIMD C API bfloat16转int32数据类型转换
asc_bfloat162int32【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit产品支持情况Ascend 950PR/Ascend 950DT支持Atlas A3 训练系列产品/Atlas A3 推理系列产品不支持Atlas A2 训练系列产品/Atlas A2 推理系列产品不支持Atlas 200I/500 A2 推理产品不支持Atlas 推理系列产品AI Core不支持Atlas 推理系列产品Vector Core不支持Atlas 训练系列产品不支持功能说明头文件路径c_api/reg_compute/reg_convert.h。将bfloat16_t类型数据转换为int32_t并支持多种舍入模式饱和/非饱和模式。关于舍入模式和饱和/非饱和模式的详细说明请参见舍入模式。由于源操作数与目的操作数类型位宽比为1:2读取数据时需要将一个VL大小的数据分为两部分根据不同接口选取索引0或者索引1。函数原型// RINT舍入模式非饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rn(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // RINT舍入模式饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rn_sat(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // RINT舍入模式非饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rn_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // RINT舍入模式饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rn_sat_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // ROUND舍入模式非饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rna(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // ROUND舍入模式饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rna_sat(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // ROUND舍入模式非饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rna_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // ROUND舍入模式饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rna_sat_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // FLOOR舍入模式非饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rd(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // FLOOR舍入模式饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rd_sat(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // FLOOR舍入模式非饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rd_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // FLOOR舍入模式饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rd_sat_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // CEIL舍入模式非饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_ru(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // CEIL舍入模式饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_ru_sat(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // CEIL舍入模式非饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_ru_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // CEIL舍入模式饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_ru_sat_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // TRUNC舍入模式非饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rz(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // TRUNC舍入模式饱和模式选取索引0的位置 __simd_callee__ inline void asc_bfloat162int32_rz_sat(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // TRUNC舍入模式非饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rz_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask) // TRUNC舍入模式饱和模式选取索引1的位置 __simd_callee__ inline void asc_bfloat162int32_rz_sat_v2(vector_int32_t dst, vector_bfloat16_t src, vector_bool mask)参数说明参数名输入/输出描述dst输出目的操作数矢量数据寄存器。src输入源操作数矢量数据寄存器。mask输入源操作数掩码掩码寄存器用于指示在计算过程中哪些元素参与计算。对应位置为1时参与计算为0时不参与计算。mask未筛选的元素在输出中置零。矢量数据寄存器和掩码寄存器的详细说明请参见data_type_definition.md。返回值说明无流水类型PIPE_V约束说明开启饱和模式和非饱和模式时需配置ctrl寄存器ctrl寄存器的详细说明请参见asc_set_ctrl.md。调用示例vector_bfloat16_t src; vector_int32_t dst; vector_bool mask asc_create_mask_b16(PAT_ALL); asc_loadalign(src, src_addr); // src_addr是外部输入的UB内存空间地址。 asc_bfloat162int32_rn(dst, src, mask);【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
RELATED

相关推荐

华为防火墙-链路聚合与单臂路由在企业多业务隔离场景下的融合配置

华为防火墙-链路聚合与单臂路由在企业多业务隔离场景下的融合配置

1. 企业网络升级的痛点与解决方案最近帮朋友公司做网络改造时遇到个典型场景:这家200人规模的企业,早期网络结构非常简单——核心防火墙直连一台二层交换机,所有终端设备都在同一个广播域里跑。随着业务扩张,陆续出现了办公区卡顿…

📅 2026/8/24 2:08:44
GBFR Logs:碧蓝幻想Relink伤害统计工具终极指南

GBFR Logs:碧蓝幻想Relink伤害统计工具终极指南

GBFR Logs:碧蓝幻想Relink伤害统计工具终极指南 【免费下载链接】gbfr-logs GBFR Logs lets you track damage statistics with a nice overlay DPS meter for Granblue Fantasy: Relink. 项目地址: https://gitcode.com/gh_mirrors/gb/gbfr-logs GBFR Logs是…

📅 2026/8/24 2:08:44
仪表放大器在传感器信号调理中的关键作用与设计实践

仪表放大器在传感器信号调理中的关键作用与设计实践

1. 传感器接口与ADC驱动的基本挑战在精密测量系统中,传感器信号往往需要经过放大和调理后才能被模数转换器(ADC)有效采集。这个看似简单的过程实际上隐藏着几个关键的技术挑战:首先,大多数工业传感器的输出信号非常微弱,典型值在毫…

📅 2026/8/24 2:08:44
MORE NEWS

更多资讯

📰

Confluence API按最后更新时间查询:CQL实战与增量同步脚本

维护一套长期在用的Confluence知识库,早晚会遇到这种需求:把最近几天更新过的页面全部拉出来过一遍,或者每天定时把改动的页面同步到另一个系统。这时候就必须用Confluence API按最后更新时间去查询,而不是写个脚本把全站页面灌进…

📰

Rocky Linux上用Docker部署LangFlow 1.7.3:可视化LLM编排实战

1. 项目背景与安装方案:为什么是这套组合先把标题拆开看,这套组合选得其实很有讲究:Linux发行版选了Rocky Linux 9.5,部署方式选了Docker,应用选了LangFlow 1.7.3。很多人一上来就直接拉镜像跑容器,结果跑完…

📰

tldraw 示例解析:用 alignShapes 与 distributeShapes 实现图形对齐与等距分布

tldraw 示例解析:用 alignShapes 与 distributeShapes 实现图形对齐与等距分布 【免费下载链接】tldraw Build infinite canvas apps in React with the tldraw SDK. Worlds best, top-most agent recommended #1 five star SDK. 项目地址: https://gitcode.com/G…

📰

React Router 框架模式(Framework Mode)安装指南:create-react-router 从零搭建到原理剖析

React Router 框架模式(Framework Mode)安装指南:create-react-router 从零搭建到原理剖析 【免费下载链接】react-router Declarative routing for React 项目地址: https://gitcode.com/GitHub_Trending/re/react-router React Rout…

📰

如何用一个 PowerShell 脚本快速精简 Windows 11 系统镜像

如何用一个 PowerShell 脚本快速精简 Windows 11 系统镜像 【免费下载链接】tiny11builder Scripts to build a trimmed-down Windows 11 image. 项目地址: https://gitcode.com/GitHub_Trending/ti/tiny11builder 装完 Windows 11 再手动卸载一堆预装应用?t…

📰

OpenHarmony上RN滚动冲突排查与解决:NestedScroll与手势机制实践

去年年底把一个 React Native 的新版本跑上 OpenHarmony 真机时,第一个让我加班到凌晨的问题不是环境配置,也不是包体积,而是页面上那个看似人畜无害的 NestedScroll 滚动冲突。外层 ScrollView 里套一个 FlatList,手指往上滑&…

TODAY

今日更新

THIS WEEK

本周精选

THIS MONTH

本月热门

读完文章,想聊聊您的网站?

告诉我们您的行业与需求,资深顾问一对一梳理方案与报价,全程免费。

📞 💬