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-isaMany 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 valuesSome 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 typesKindMnemonicsSigneds4,s8,s16,s32,s64Unsignedu4,u8,u16,u32,u64Floating-point typesKindMnemonics4-bit float familiesfp4,hif4,mxfp48-bit float familiesfp8,hif8,mxfp816-bit float familiesbf16,fp1632-bit float familiestf32,hf32,fp3264-bit floatfp64Bit-width (typeless) valuesKindMnemonicsTypeless bitsb4,b8,b16,b32,b64Compatibility rules (ISA convention)Two mnemonics are considered compatible when they have the same bit-width, and either:they are the same kind, orthey are signed vs unsigned integers of the same width, orone 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 enumsAll enums below are available via#include pto/pto-inst.hpp.pto::RoundModeDefined ininclude/pto/common/constants.hpp. Used byTCVTto specify rounding behavior (e.g.,RoundMode::CAST_RINT).pto::CmpModeDefined ininclude/pto/common/type.hpp. Used byTCMPS(andTCMP) for per-element comparisons (EQ/NE/LT/GT/GE/LE).pto::MaskPatternDefined ininclude/pto/common/type.hpp. Used by the mask-patternTGATHERvariant to select a predefined 0/1 mask pattern.pto::AtomicTypeDefined ininclude/pto/common/constants.hpp. Used as the template parameter toTSTORE..., AtomicType::AtomicAdd(orAtomicNone).pto::AccToVecModeandpto::ReluPreModeDefined ininclude/pto/common/constants.hpp. Used byTMOVoverloads when moving from accumulator tiles with optional quantization and/or ReLU behavior.pto::PadValueDefined 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(TileTileType::Vec, float, 16, 16 dst, TileTileType::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),仅供参考