当前位置: 首页 > 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.rkmt.cn/news/1518325.html

相关文章:

  • 2025最简单IDM激活教程:永久免费解锁下载神器终极指南
  • ReadCat小说阅读器:5个步骤打造你的纯净数字书房
  • LITIENGINE社区生态解析:插件、工具与第三方资源完全指南 [特殊字符]
  • PacketEvents事件系统完全指南:从基础监听器到高级事件处理
  • BthPS3驱动技术指南:解决PS3手柄在Windows系统的蓝牙连接难题
  • MES与ERP的区别和联系到底是什么?
  • zsh-async社区最佳实践:来自开源项目的10个实用技巧
  • 云顶之弈策略博弈中信息优势的构建:TFT Overlay实战深度解析
  • 2026大型不锈钢雕塑厂家选型指南及实力排行 - 曲阳嘉华园林
  • 广州卡地亚做深度保养是否必须拆卸表盘!广州卡地亚机芯检修逻辑,亨得利区分简易维保与全拆保养差异 - 亨得利官方维修中心
  • F3D终极指南:快速掌握轻量级3D查看器的完整使用技巧
  • 苏州首饰回收实测指南|本地靠谱实体门店排名推荐 - 讯息早知道
  • 视频分析AI工具:让AI看懂视频的终极指南
  • Duplicity存档编辑器:缺氧游戏存档修改的终极免费解决方案
  • MES系统到底是什么?解决什么问题?
  • texture-vs-shape实验复现:使用R脚本进行数据可视化与分析的完整指南
  • Fan Control:掌握Windows风扇控制的终极指南,打造静音高效系统
  • 名目张胆定制服务
  • 别再手动改格式了!用Python的json模块5分钟搞定JSONL转JSON(附两种输出格式代码)
  • 模块化图片编辑架构:基于fabric.js和Vue的插件化设计器技术解析
  • 2026福州香奈儿回收行业深度解读!市场走势、价值逻辑与正规渠道解析 - 薛定谔的梨花猫
  • UndertaleModTool终极指南:零基础掌握游戏修改与模组制作
  • OneDev云原生DevOps架构解密:一体化平台如何重塑企业级软件交付
  • 5分钟实战指南:ComfyUI视频自动化工具如何提升AI视频创作效率
  • ᅟᅠ
  • 实战云教师AI素养培训产品是什么?助力教师跨越技术鸿沟详解 - 实战云官方
  • 闲置老旧金银首饰高效变现实用攻略 2026:南京靠谱首饰回收商家实地测评榜单 - 讯息早知道
  • 如何用AI化学助手ChemCrow解决12种专业化学难题
  • i.MX23 LRADC模块实战:从硬件原理到寄存器配置与避坑指南
  • 西安少儿篮球培训推荐哪家?2026超全择校测评,帮家长少走弯路 - 中媒介