当前位置: 首页 > news >正文

CANN/asc-devkit数学API示例介绍

Math API Sample Introduction

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

Overview

This sample collection demonstrates typical usage of various Math API features and provides corresponding end-to-end implementations.

Sample List

Directory NameDescriptionSupported Products
acoshThis sample demonstrates an operator implementation based on the Acosh high-level API. The sample computes the inverse hyperbolic cosine function element-wiseAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
axpy_half_floatThis sample implements the functionality of multiplying each element in the source operand src by a scalar and adding it to the corresponding element in the destination operand dst using Axpy. The data type combinations for the source and destination operands of the Axpy interface can only be: (half, half), (float, float), or (half, float). In this sample, the input tensor and scalar data types are half, and the output tensor data type is float. This sample implements the Axpy operator using Ascend C and uses the <<<>>> kernel call operator to complete the basic flow of running and verifying the operator kernel function on the NPU side, providing the corresponding end-to-end implementationAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
bitwiseandThis sample demonstrates an operator implementation based on the BitwiseAnd high-level API. The sample performs a bitwise AND operation on two inputsAscend 950PR/Ascend 950DT
ceilThis sample demonstrates an operator implementation based on the Ceil high-level API. The sample obtains the smallest integer greater than or equal to x, that is, rounding toward positive infinityAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
clampThis sample demonstrates an operator implementation based on the Clamp high-level API. Values in the input that are not nan and fall outside the [min, max] range are clipped to max or min. If min is greater than max, all non-nan values are set to maxAscend 950PR/Ascend 950DT
clampminThis sample demonstrates an operator implementation based on the ClampMin high-level API. The sample replaces numbers in srcTensor that are less than scalar with scalar, while numbers greater than or equal to scalar remain unchanged, and outputs as dstTensorAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
cumsumThis sample introduces how to call the CumSum high-level API to implement the cumsum operator, which computes cumulative sums along rows or columns of an input tensorAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
erfThis sample demonstrates an operator implementation based on the Erf high-level API. The sample computes the error function element-wiseAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
expThis sample demonstrates an operator implementation based on the Exp high-level API. The sample computes the natural exponential element-wise. Users can choose whether to use the Taylor series expansion formula for computationAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
fmaThis sample demonstrates an operator implementation based on the Fma high-level API. The sample computes the result of multiplying two inputs element-wise and then adding a third inputAscend 950PR/Ascend 950DT
fmodThis sample demonstrates an operator implementation based on the Fmod high-level API. The sample computes the remainder of dividing two floating-point numbers a and b element-wiseAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
fracThis sample demonstrates an operator implementation based on the Frac high-level API. The sample computes the fractional part element-wiseAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
isfiniteThis sample demonstrates an operator implementation based on the IsFinite high-level API. The sample determines whether input floating-point numbers are neither NAN nor INF element-wise. The output result is either a floating-point number or a boolean valueAscend 950PR/Ascend 950DT
logThis sample demonstrates an operator implementation based on the Log high-level API. The sample computes logarithms with base e, 2, or 10 element-wiseAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
logicalandThis sample demonstrates an operator implementation based on the LogicalAnd high-level API. The sample performs a logical AND operation element-wise. When the input data type is not bool, zero is treated as False and non-zero data is treated as TrueAscend 950PR/Ascend 950DT
powerThis sample demonstrates an operator implementation based on the Power high-level API. The sample implements element-wise power operations and supports three modes: tensor-to-tensor, tensor-to-scalar, and scalar-to-tensor power operationsAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products
rintThis sample demonstrates an operator implementation based on the Rint high-level API. The sample obtains the integer closest to the input data. If two integers are equally close, the even number is selectedAscend 950PR/Ascend 950DT
whereThis sample demonstrates an operator implementation based on the Where high-level API. The sample selects elements from two source operands based on specified conditions to generate a destination operand. Both source operands can be either LocalTensor or scalarAscend 950PR/Ascend 950DT
xorThis sample demonstrates an operator implementation based on the Xor high-level API. The sample performs XOR operations element-wiseAscend 950PR/Ascend 950DT
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products

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

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

http://www.jsqmd.com/news/1006539/

相关文章:

  • 2026工艺金饰估价避亏技巧,青岛五家回收商铺实地亲测分享 - 讯息早知道
  • 性能拉满 OpenClaw 小龙虾 Win10 专属优化部署指南(包含安装包)
  • 5分钟彻底清理Mac应用残留:开源清理神器Pearcleaner终极指南
  • Power BI三大核心组件(Power Query/Pivot/View)到底怎么用?一个完整的数据分析流程拆解
  • 多核音频处理器引脚复用与系统设计实战解析
  • 英雄联盟回放播放神器:ROFL-Player终极使用指南
  • 2026 年沈阳智慧门店系统/收银系统/综合实力评测推荐:旺鑫电子本地服务能力全行业适配遥遥领先 - 资讯速览
  • 2025最简单IDM激活教程:永久免费解锁下载神器终极指南
  • zsh-async测试与质量保证:编写可靠的异步脚本
  • 如何一键清理Windows 11系统臃肿?Win11Debloat终极优化指南
  • 别只看足金!你的18K金、铂金、旧金条都能卖钱:聊城全品类回收指南 - 润富黄金回收
  • Cursor Pro破解工具终极指南:3分钟实现AI编程助手永久免费使用
  • 2026江苏电气成套与配电系统十大品牌:汉发电气实力领跑,一站式电力工程解决方案优选 - 安互工业信息
  • ReadCat小说阅读器:5个步骤打造你的纯净数字书房
  • LITIENGINE社区生态解析:插件、工具与第三方资源完全指南 [特殊字符]
  • PacketEvents事件系统完全指南:从基础监听器到高级事件处理
  • BthPS3驱动技术指南:解决PS3手柄在Windows系统的蓝牙连接难题
  • 2026石家庄名包回收七店实测:LV香奈儿爱马仕闲置变现与正规门店甄选 - 薛定谔的梨花猫
  • 2026年安徽省中考考不上高中怎么办?上合肥哪个中职学校好? - 我叫小周
  • Windows安卓应用安装器:轻松在电脑上安装APK文件的完整指南
  • BilibiliDown:3分钟搞定B站视频下载的终极解决方案
  • MES与ERP的区别和联系到底是什么?
  • 成为 AI 智能体工程师的 10 个步骤
  • Macaron-V1-Preview-749B安装与配置:从单适配器检查到完整路由服务的完整流程
  • zsh-async社区最佳实践:来自开源项目的10个实用技巧
  • Fillinger智能填充插件:3分钟让Illustrator图案填充效率提升10倍
  • OmicVerse终极指南:5分钟掌握多组学生物信息学分析神器
  • 云顶之弈策略博弈中信息优势的构建:TFT Overlay实战深度解析
  • 2026大型不锈钢雕塑厂家选型指南及实力排行 - 曲阳嘉华园林
  • gh_mirrors/do/dotnet-docs-samples完全指南:轻松掌握Google Cloud .NET开发的终极入门教程