About Ascend C

Ascend C is a programming language developed based on Compute Architecture for Neural Networks (CANN) for operator development. It supports native C and C++ standards and features both development efficiency and runtime performance. The operator program compiled based on Ascend C runs on the Ascend AI Processor through compiler running and runtime scheduling. With Ascend C, developers can efficiently customize algorithms based on the Ascend AI hardware. More information is available at Ascend C.

Ascend C provides multiple levels of APIs to meet operator development requirements in multi-dimensional scenarios.

  • C APIs at the language extension layer: Open the complete programming capabilities of the chip, support memory allocation for arrays, and generally use pointer-based programming, providing a consistent C language programming experience with the industry.
  • Basic APIs: C++ library APIs for tensor-based programming, implementing abstraction at the single instruction level and providing flexible control capabilities for underlying operator development.
  • Advanced APIs: APIs encapsulating single-core common algorithms, covering some common compute algorithms (such as convolution and matrix operations) and significantly lowering the threshold for developing complex algorithms.
  • Operator template libraries: provides complete operator implementation reference based on templates, simplifies tiling development, and supports custom extension.
  • Python frontend: The PyAsc programming language provides comprehensive underlying chip programming capabilities based on the native Python APIs and supports the development of high-performance Ascend C operators based on Python APIs.

Quick Start

Progressive Knowledge

Using printf to Print Data

Concepts and Principles

API Reference

Basic APIs High-Level APIs Utils API

Operator Practice References

Ascend C can be used on the following AI processor models:

  • Atlas 350 Accelerator Card
  • Atlas A3 training product / Atlas A3 inference product
  • Atlas A2 training product / Atlas A2 inference product
  • Atlas 200I/500 A2 inference product
  • Atlas inference product
  • Atlas training product