Ascend C API List

Ascend C provides a hierarchical API system that covers complete capabilities ranging from low-level C extensions to high-level C++ class libraries. Based on standard C/C++ syntax, it enables developers to flexibly implement fine-grained memory management and efficient vector/matrix operations under multiple programming models such as AI Core (SIMD/SIMT) and AI CPU.

API Classification Overview

The following table shows the overall classification of Ascend C APIs, helping developers quickly locate the required APIs based on the programming model and functional requirements.

Table 1 Ascend C API Classification

API Level-1 CategoryAPI Level-2 CategoryClassification Description
SIMD APIBasic APIAbstracts hardware capabilities, exposes chip capabilities, and ensures completeness and compatibility. APIs marked as ISASI (Instruction Set Architecture Special Interface, which are hardware-architecture-related APIs) cannot guarantee compatibility across hardware versions.
SIMD APIC APIPure C APIs that expose the complete programming capabilities of the chip, support array memory allocation, are generally pointer-based, and provide a C-language programming experience consistent with the industry.
SIMD APIAdvanced APIImplements some commonly used computation algorithms to improve programming and development efficiency, and typically invokes multiple basic APIs. Advanced APIs include the math library, Matmul, Softmax, and other APIs. Advanced APIs guarantee compatibility.
SIMT API-Benchmarked against the industry, it provides single-instruction multiple-thread APIs that implement parallel computation in the form of multiple threads per instruction. SIMT programming is mainly used for vector computation and is especially suitable for scenarios such as discrete access and complex control logic. The SIMT API supports two programming models: SIMT programming and SIMD-SIMT hybrid programming. For the specific supported APIs, see SIMT Programming API List and SIMD-SIMT Hybrid Programming API List, respectively.
AI CPU API-Usually serves as a supplement to the above APIs, mainly handling non-matrix, branch-intensive computations with relatively complex logic.
Utils API-Rich general-purpose utility classes covering the standard library (currently supporting only SIMD), platform information retrieval, runtime compilation, and log output, supporting developers in efficiently implementing operator development and performance optimization.

Header Files and Library Files Required for Calling APIs

After installing the firmware, driver, and CANN software package, you can reference the header files and library files of Ascend C APIs only after installing, compiling, and running applications.

You can include the required files based on the Ascend C APIs actually used. The purpose of each header file is described in the following table.

Table 2 SIMT programming model header file list

Header FileDescriptionCorresponding Library File
simt/asc_simt.hProvides the external APIs of the SIMT API. If the computation requires only a specific data type such as fp8, you can include only simt_api/asc_fp8.h.Not applicable

For more details about the header files included in SIMT programming, see SIMT-API.

Table 3 SIMD basic programming capability header file list

API Capability LevelDevelopment ScenarioHeader FileDescriptionCorresponding Library File
C language pointer-based programmingDevelops any operator (including fused operators)c_api/asc_simd.hProvides the full set of external APIs of the SIMD C API.Not applicable
C++ Tensor-based programmingDevelops any operator (including fused operators)tensor_api/tensor.hProvides the full set of external APIs of the SIMD C++ Tensor API.Not applicable
TPipe/TQue framework-based programmingDevelops any operator (including fused operators)basic_api/kernel_basic_intf.hProvides the full set of external APIs of SIMD TPipe/TQue framework-based programming.Not applicable
TPipe/TQue framework-based programmingDevelops only vector operatorsbasic_api/kernel_vec_intf.hProvides the external APIs of SIMD TPipe/TQue framework-based programming required for vector computation.Not applicable
TPipe/TQue framework-based programmingDevelops only matrix operatorsbasic_api/kernel_cube_intf.hProvides the external APIs of SIMD TPipe/TQue framework-based programming required for matrix computation.Not applicable

Table 4 SIMD high-level API header file list

Header FileDescriptionCorresponding Library File
adv_api/kernel_api.hProvides the Device-side external APIs of the SIMD high-level API. It can be called only in the TPipe/TQue framework-based programming mode.Not applicable
adv_api/tiling_api.hProvides the Host-side external APIs of the SIMD high-level API. It can be called only in the TPipe/TQue framework-based programming mode.libtiling_api.a