当前位置:网站首页>Overview of cann interface calling process
Overview of cann interface calling process
2022-06-10 15:02:00 【Hua Weiyun】
CANN What we are looking at in the library is c++ Code for , stay WEB What is popular in the times is JAVA, instead of c perhaps c++, One of the reasons is JAVA There is no need to pay attention to memory allocation and release , And these are just c or c++ Programming is very important , As a result, a lot of code fragments are generated , When looking at the code , It will slightly affect the focus on the code of normal process .
Again , After the interface call , For the robustness and fault tolerance of the program , It is often necessary to check the returned result of the call and handle the error , When you look at the code in this way, you will feel a little cumbersome .
So put these aside for the time being , Let's mainly focus on the interface calling main process , When looking at the code in this way, we can get to the point , It is not easy to be submerged in code details .
Let's first introduce CANN The concept of , It is a technical architecture , The official definition is :
- CANN(Compute Architecture for Neural Networks) Huawei aims at AI The heterogeneous computing architecture introduced in the scenario , By providing a multi-level programming interface , Support users to quickly build a platform based on shengteng AI Application and business .
Then in the code, we often look at the name with acl The interface at the beginning , that ACL Is a computing language , The concept is defined as follows :
- AscendCL(Ascend Computing Language) It is a set of tools for developing deep neural network reasoning applications on the shengteng platform C Language API library , Provide operation resource management 、 memory management 、 Model loading and execution 、 Operator loading and execution 、 Media data processing, etc API, Can achieve Utilize the hardware computing resources of shengteng 、 It's rising CANN On the platform Conduct deep learning reasoning calculation 、 Graphics and image preprocessing 、 The ability of single operator to accelerate calculation . Simply speaking , It's unified API frame , Realize the call to all resources .

In the picture above Computing resource layer It's shengteng AI The hardware computing power foundation of the processor , It mainly completes matrix correlation calculation of neural network 、 Complete the control operator / Scalar / Vector and other general calculation and execution control functions 、 Complete image and video data preprocessing , It provides execution guarantee for deep neural network calculation .
It can also be seen from the figure that ,ACL Include and CANN In , And in CANN The top layer of the structural hierarchy .
therefore , Development of application layer , The interface used directly is ACL Interface . Of course , There can be third-party frameworks /lib Library to call ACL Form more advanced interface services to provide to applications .
ACL The advantages here must be listed :
- Highly abstract : Operator compilation 、 load 、 Executive API Come back , Compared to one for each operator API,AscendCL A sharp decrease API Number , Reduce complexity .
- Backward compatibility :AscendCL Backward compatibility , Ensure that after the software upgrade , Programs compiled based on the old version can still run on the new version .
- Zero sense chip : A set of AscendCL The interface can realize the unification of application code , Multiple shengteng AI No processor differences .
Take a look at ACL The overall invocation process of :

In fact, this process covers Rise CANN Experience officer phase IV Contents of Li , One is model reasoning , One is data preprocessing ( video 、 Zoom in and out of the picture 、 Switching, etc ).
Okay , Master the overall calling process , Learn about us CANN samples The example code in is helpful .
边栏推荐
- Shutter wrap button bottomnavigationbar learning summary 4
- 竟然还有人说ArrayList是2倍扩容,今天带你手撕ArrayList源码
- Detailed explanation of binary search
- Ada Logics:CRI-O整体安全审计项目
- 2022 the 15th Nanjing International Industrial Automation Exhibition
- 【云原生 | Kubernetes篇】深入RC、RS、DaemonSet、StatefulSet(七)
- Notes on the second test of C language
- 面试题详情
- RSA a little bit of thought
- Get to know RPC
猜你喜欢

How to realize ERP extranet connection?

Detailed explanation of binary search

Shutter wrap button bottomnavigationbar learning summary 4

超强实操!手把手教学Kinect深度图与RGB摄像头的标定与配准

AutoRunner自动化测试工具如何创建项目-Alltesting|泽众云测试

WordPress的管理员用户名是如何泄露的

Applet network request promise

2022 Nanjing International Smart site equipment exhibition

远程监控及数据采集解决方案

At the early stage of product development, do you choose to develop apps or applets?
随机推荐
面试题详情
CVPR 2022 oral | SCI: fast, flexible and robust low light image enhancement
MITM(中间人攻击)
如何构建以客户为中心的产品蓝图:来自首席技术官的建议
几种方式可以实现 JMeter 参数化?
LeetCode_21(合并两个有序链表)
【Rust日报】2022-04-19 Rust异步框架的性能评估
what‘t the meaning of “de facto“
二分查找详解
Remote monitoring and data acquisition solution
详解OpenCV的函数filter2D(),并提醒大家它做的运算并不是卷积运算而是相关运算
Does Fortran have a standard library
This article introduces you to j.u.c's futuretask, fork/join framework and BlockingQueue
At the early stage of product development, do you choose to develop apps or applets?
AUTOCAD——设置文字间距与行距
Create a space of local value together. In 2022, China successfully held the "one hundred cities tour · Ningbo Station" for commercial distribution
Golang Beep包 播放mp3 无法获取总长度 streamer.Len()为0 其他格式却可以
Wechat applet returns to the previous page and transfers parameters
超强实操!手把手教学Kinect深度图与RGB摄像头的标定与配准
这个牛逼的低代码生成器,现在开源了!