news 2026/5/9 13:25:43

CANN/pto-isa标量与枚举参数

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/pto-isa标量与枚举参数

Scalar Parameters and Enums

【免费下载链接】pto-isaParallel 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 Ascend platforms.项目地址: https://gitcode.com/cann/pto-isa

Many PTO intrinsics take scalar parameters in addition to tiles (e.g., comparison modes, rounding modes, atomic modes, or literal constants).

This document summarizes the scalar/enumeration types that appear in the public intrinsics ininclude/pto/common/pto_instr.hpp.

Scalar values

Some instructions take scalar values as plain C++ types:

  • TADDS/TMULS/TDIVS/TEXPANDS: scalar isTileData::DType.
  • TMINS: scalar is a template typeTand must be convertible to the tile element type.
  • TCI: scalarSis a template typeTand must matchTileData::DType(enforced bystatic_assertin the implementation).

PTO ISA type mnemonics (reference)

ISA documentation uses short type mnemonics (e.g.,fp16,s8) when describing instruction semantics. Backends may support only a subset at any given time; seeinclude/README.mdfor implementation status.

Integer types

KindMnemonics
Signeds4,s8,s16,s32,s64
Unsignedu4,u8,u16,u32,u64

Floating-point types

KindMnemonics
4-bit float familiesfp4,hif4,mxfp4
8-bit float familiesfp8,hif8,mxfp8
16-bit float familiesbf16,fp16
32-bit float familiestf32,hf32,fp32
64-bit floatfp64

Bit-width (typeless) values

KindMnemonics
Typeless bitsb4,b8,b16,b32,b64
Compatibility rules (ISA convention)

Two mnemonics are considered compatible when they have the same bit-width, and either:

  • they are the same kind, or
  • they are signed vs unsigned integers of the same width, or
  • one side is a typeless bits type (b*) of the same width.

These are documentation-level rules used to describe instruction legality. Individual instructions may further restrict types.

Core enums

All enums below are available via#include <pto/pto-inst.hpp>.

pto::RoundMode

Defined ininclude/pto/common/constants.hpp. Used byTCVTto specify rounding behavior (e.g.,RoundMode::CAST_RINT).

pto::CmpMode

Defined ininclude/pto/common/type.hpp. Used byTCMPS(andTCMP) for per-element comparisons (EQ/NE/LT/GT/GE/LE).

pto::MaskPattern

Defined ininclude/pto/common/type.hpp. Used by the mask-patternTGATHERvariant to select a predefined 0/1 mask pattern.

pto::AtomicType

Defined ininclude/pto/common/constants.hpp. Used as the template parameter toTSTORE<..., AtomicType::AtomicAdd>(orAtomicNone).

pto::AccToVecModeandpto::ReluPreMode

Defined ininclude/pto/common/constants.hpp. Used byTMOVoverloads when moving from accumulator tiles with optional quantization and/or ReLU behavior.

pto::PadValue

Defined ininclude/pto/common/constants.hpp. Part of theTile<...>template and used by some implementations to define how out-of-valid regions are treated (e.g., select/copy/pad paths).

Example

#include <pto/pto-inst.hpp> using namespace pto; void example(Tile<TileType::Vec, float, 16, 16>& dst, Tile<TileType::Vec, float, 16, 16>& src) { TCVT(dst, src, RoundMode::CAST_RINT); TMINS(dst, src, 0.0f); }

【免费下载链接】pto-isaParallel 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 Ascend platforms.项目地址: https://gitcode.com/cann/pto-isa

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

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

公平AI与领域知识融合:构建可解释的酒驾风险预测模型

1. 项目概述&#xff1a;当AI遇见“酒后不开车”的严肃命题“酒后不开车”早已是深入人心的社会共识&#xff0c;但每年因酒驾导致的悲剧依然时有发生。作为一名长期关注数据科学在公共安全领域应用的从业者&#xff0c;我一直在思考&#xff0c;能否利用现有的技术手段&#x…

作者头像 李华
网站建设 2026/5/9 13:24:15

CANN/ops-blas Cswap算子测试

Cswap算子实现 【免费下载链接】ops-blas 本项目是CANN提供的高性能线性代数计算以及轻量化GEMM调用算子库。 项目地址: https://gitcode.com/cann/ops-blas 概述 BLAS Cswap算子实现。 Cswap(Complex Swap)算子实现了两个复数向量的交换运算&#xff0c;是BLAS基础线…

作者头像 李华
网站建设 2026/5/9 13:21:30

CANNSHMEM SIMT RMA标量传输示例

样例介绍 【免费下载链接】shmem CANN SHMEM 是面向昇腾平台的多机多卡内存通信库&#xff0c;基于OpenSHMEM 标准协议&#xff0c;实现跨设备的高效内存访问与数据同步。 项目地址: https://gitcode.com/cann/shmem 本样例旨在展示 SIMD 与 SIMT 混合编译模式下&#x…

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

CANNBot技能:模型推理预取优化

【免费下载链接】cannbot-skills CANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体&#xff0c;本仓库为其提供可复用的 Skills 模块。 项目地址: https://gitcode.com/cann/cannbot-skills name: model-infer-prefetch description: 基于 PyTorch 框架的昇腾 N…

作者头像 李华
网站建设 2026/5/9 13:15:31

组态屏工程备份 / 恢复 / 加密 / 密码忘记

在工业自动化现场&#xff0c;组态屏作为人机交互的核心设备&#xff0c;承载着设备监控、参数设置、报警记录等关键功能。而组态工程文件&#xff0c;则是这块屏幕的“灵魂”——一旦工程丢失或损坏&#xff0c;重新编写不仅耗时数日&#xff0c;甚至可能因工艺参数遗忘而导致…

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

C 语言11 函数传参与递归

函数的参数传递1.值传递&#xff0c;实参数通过赋值运算符把参数内容赋值给形参的形式&#xff0c;形参是实参的一个副本。数据内容是相同的。实参的内存空间和形参的是独立的。值传递只能读取实参的值&#xff0c;不能进行修改。2.地址传递。实参传递变量的内存地址值。即可以…

作者头像 李华