API Overview

This chapter provides an overview of APIs. For details about the APIs, see Ascend C APIs.

Ascend C provides a group of class library APIs, and you can use the standard C++ syntax and class library APIs for programming. Ascend C programming class library APIs are classified into the following types:
  • Basic data structures: basic data structures used in kernel APIs, such as GlobalTensor and LocalTensor.
  • Basic APIs: implement abstract hardware capabilities and open chip capabilities to ensure completeness and compatibility. APIs marked as Instruction Set Architecture Special Interface (ISASI, hardware architecture-related APIs) cannot guarantee compatibility across hardware versions.
  • High-level APIs: implement common compute algorithms to improve programming and development efficiency based on basic APIs. High-level APIs include math library, Matmul, and Softmax APIs. High-level APIs can ensure compatibility.
  • Utils APIs (common auxiliary functions): provides various common utility classes, covering functions such as standard library, platform information acquisition, runtime compilation, and log output. These APIs empower you to efficiently develop operators and optimize performance.

Header file directory of Ascend C APIs:

  • Basic APIs: ${INSTALL_DIR}/include/ascendc/basic_api/interface
  • High-level APIs: (Note that if the APIs contained in the following header file directories are not declared in the documentation, they are called indirectly, and developers do not need to pay attention to them.)
    • ${INSTALL_DIR}/include/ascendc/highlevel_api/lib
    • ${INSTALL_DIR}/include/tiling

Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.