Overview

This section describes the main functions and basic concepts of app development and provides suggestions on how to use this document.

Introduction

Compute Architecture for Neural Networks (CANN) provides a C language API library (the API name prefix is acl). You can use this set of APIs to utilize the hardware computing resources of Ascend AI Processor for deep learning and inference, graphics and image preprocessing, and single-operator acceleration computing on CANN. This C language API library, which is referred to as acl APIs in the following sections, contains APIs for runtime management, single-operator calling, model management, media data processing, and more.

Application scenarios of acl APIs:

  • Invoked by components in CANN: The runtime management functions, such as device resource management and memory management, are invoked.
  • Calling through an AI framework: Functions, such as runtime management and single-operator calling, are invoked to use the computing capabilities of Ascend AI Processor.
  • AI app development: You can call acl APIs to develop image classification and target recognition apps, and more.
  • Development of third-party libraries: You can encapsulate acl APIs into third-party libraries to offer capabilities such as runtime management.

Advantages of acl APIs:

  • High-level abstraction: The APIs for operator compilation, loading, and execution are unified. In this way, the number of APIs and complexity are greatly reduced.
  • Backward compatibility: acl APIs are backward compatible to ensure that apps built based on an earlier version can still run on a later version.
  • Smooth development experience: acl APIs work the same for Ascend AI Processor of different versions.

Basic Concepts

Table 1 Concepts

Term

Description

Synchronous/Asynchronous

The synchronous and asynchronous mentioned in this document are from the perspective of the caller and executor.

  • If an API in this document is called and a response is returned before the task is complete, the scheduling is asynchronous.
  • If an API in this document is called and a response is returned after the task is complete, the scheduling is synchronous.

Process/Thread

Unless otherwise specified, the processes and threads mentioned in this document refer to the processes and threads in user apps.

Channel

An RGB image has three channels: red, green, and blue. HSV stands for hue, saturation, and value (brightness) and is an alternative representation of the RGB color model.

Ascend EP Form

If the PCIe of the Ascend AI Processor works in secondary mode, the form is called Ascend EP form.

In Ascend EP form, the host works as the primary side, and the device works as the secondary side. Customers' AI apps run on the host. The Ascend AI Processor functions as a device and connects to the host over the PCIe interface. The host interacts with the device over the PCIe interface and loads AI tasks to the Ascend AI Processor on the device. The device co-works with the host (namely, an x86 or Arm server) over the PCIe interface. The device provides only the NN compute capability for the host, and the central processing unit (CPU) resources on the device can be called only by the host.

Ascend RC Form

If the PCIe of the Ascend AI Processor works in primary mode, the form is called Ascend RC form.

In Ascend RC form, the CPUs of the products directly run the AI service software specified by the running user and peripherals, such as network cameras, I2C sensors, and SPI monitors, are connected to the products as secondary devices.

Document Usage Suggestions

If you are using this document for the first time and you have learned what acl APIs do but do not know how to develop apps, you can follow the suggestions below:

  1. Install the firmware, driver, and CANN software by referring to the CANN Software Installation Guide.
  2. Click Link to obtain the entry example, download the sample source code, compile and run the apps as instructed in README.md, and understand the key code logic of acl APIs through the source code.
  3. Learn the overall API categories and API calling process by referring to Header Files and Library Files and API Call Sequence.
  4. Learn how to develop other apps by referring to Single-Operator Calling, Media Data Processing (Including Images and Videos), and Model Management and other sections.

To understand this document better, you are supposed to have ability in C/C++ programming and a basic understanding of machine learning or deep learning.