news 2026/5/9 12:51:32

CANN/atvoss参数使用枚举

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/atvoss参数使用枚举

ParamUsage

【免费下载链接】atvossATVOSS(Ascend C Templates for Vector Operator Subroutines)是一套基于Ascend C开发的Vector算子库,致力于为昇腾硬件上的Vector类融合算子提供极简、高效、高性能、高拓展的编程方式。项目地址: https://gitcode.com/cann/atvoss

功能说明

用来指定参数的数据流向,这里的参数是指struct Param。

所属头文件链接

/include/expression/expr_template.h

数据结构

enum class ParamUsage { IN, OUT, IN_OUT, }

数据结构成员说明

成员名称成员类型成员说明默认值
INNA输入NA
OUTNA输出NA
IN_OUTNA输入&输出NA

约束说明

NA

使用示例

template <typename InputDtype, typename OutputDtype> struct AddSubConfig { struct AddSubCompute { template <template <typename> class Tensor> __host_aicore__ constexpr auto Compute() const { // 🔥🔥🔥 使用示例 🔥🔥🔥 auto in1 = Atvoss::PlaceHolder<1, Tensor<InputDtype>, Atvoss::ParamUsage::IN>(); auto in2 = Atvoss::PlaceHolder<2, Tensor<InputDtype>, Atvoss::ParamUsage::IN>(); auto in3 = Atvoss::PlaceHolder<3, InputDtype, Atvoss::ParamUsage::IN>(); auto out = Atvoss::PlaceHolder<4, Tensor<OutputDtype>, Atvoss::ParamUsage::OUT>(); // 🔥🔥🔥 使用示例 🔥🔥🔥 return (out = in1 + in2 - in3); }; }; using ArchTag = Atvoss::Arch::DAV_3510; using BlockOp = Atvoss::Ele::BlockBuilder<AddSubCompute, ArchTag>; using KernelOp = Atvoss::Ele::KernelBuilder<BlockOp>; using DeviceOp = Atvoss::DeviceAdapter<KernelOp>; }; template <typename InputDtype, typename OutputDtype> static void Run() { /* ACL init and stream create */ ... Atvoss::Tensor<InputDtype> in1(deviceIn1, {{3, 4, 0, 0, 0, 0, 0, 0}}, 2); Atvoss::Tensor<InputDtype> in2(deviceIn2, {{3, 4, 0, 0, 0, 0, 0, 0}}, 2); InputDtype in3 = 5.0; Atvoss::Tensor<OutputDtype> out(deviceOut, {{3, 4, 0, 0, 0, 0, 0, 0}}, 2); auto arguments = Atvoss::ArgumentsBuilder{}.inputOutput(in1, in2, in3, out).attr("dim", 5).build(); using DeviceOp = typename AddSubConfig<InputDtype, OutputDtype>::DeviceOp; DeviceOp deviceOp; deviceOp.Run(arguments, stream); } int main(int argc, char const* argv[]) { Run<float, float>(); return 0; }

【免费下载链接】atvossATVOSS(Ascend C Templates for Vector Operator Subroutines)是一套基于Ascend C开发的Vector算子库,致力于为昇腾硬件上的Vector类融合算子提供极简、高效、高性能、高拓展的编程方式。项目地址: https://gitcode.com/cann/atvoss

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

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

CANN/AMCT Quantile量化

AMCT大模型Quantile分位量化 【免费下载链接】amct AMCT是CANN提供的昇腾AI处理器亲和的模型压缩工具仓。 项目地址: https://gitcode.com/cann/amct 1 量化前提 1.1 安装依赖 本sample依赖包可参考requirements.txt 需要注意的是torch_npu包版本需要与Python、torch…

作者头像 李华
网站建设 2026/5/9 12:44:32

CANN/pypto pow函数API文档

&#xfeff;# pypto.pow 【免费下载链接】pypto PyPTO&#xff08;发音: pai p-t-o&#xff09;&#xff1a;Parallel Tensor/Tile Operation编程范式。 项目地址: https://gitcode.com/cann/pypto 产品支持情况 产品是否支持Ascend 950PR/Ascend 950DT√Atlas A3 训练…

作者头像 李华
网站建设 2026/5/9 12:42:35

范式革新:时序媒体智能解析引擎与结构化知识蒸馏技术

范式革新&#xff1a;时序媒体智能解析引擎与结构化知识蒸馏技术 【免费下载链接】extract-video-ppt extract the ppt in the video 项目地址: https://gitcode.com/gh_mirrors/ex/extract-video-ppt 在数字内容爆炸式增长的今天&#xff0c;视频已成为知识传递的主要载…

作者头像 李华
网站建设 2026/5/9 12:42:33

Switch大气层系统深度配置:从零构建你的个性化游戏环境

Switch大气层系统深度配置&#xff1a;从零构建你的个性化游戏环境 【免费下载链接】Atmosphere-stable 大气层整合包系统稳定版 项目地址: https://gitcode.com/gh_mirrors/at/Atmosphere-stable 还在为Switch的官方限制感到束手束脚吗&#xff1f;大气层系统为你打开了…

作者头像 李华
网站建设 2026/5/9 12:42:07

QQ音乐加密格式终极解密指南:qmc-decoder让音乐真正属于你

QQ音乐加密格式终极解密指南&#xff1a;qmc-decoder让音乐真正属于你 【免费下载链接】qmc-decoder Fastest & best convert qmc 2 mp3 | flac tools 项目地址: https://gitcode.com/gh_mirrors/qm/qmc-decoder 你是否曾经下载了QQ音乐的歌曲&#xff0c;却发现它们…

作者头像 李华
网站建设 2026/5/9 12:41:00

CANN/pto-isa轴归约与扩展操作

Axis Reduce / Expand 【免费下载链接】pto-isa Parallel Tile Operation (PTO) is a virtual instruction set architecture designed by Ascend CANN, focusing on tile-level operations. This repository offers high-performance, cross-platform tile operations across …

作者头像 李华