目录

API Overview

Ascend C operator is programmed using the standard C++ syntax and a set of class library APIs. You can select appropriate APIs based on your requirements. The following figure shows the programming class library APIs of Ascend C. The operands of Ascend C APIs are of the tensor type: GlobalTensor and LocalTensor. The class library APIs are classified into basic APIs and high-level APIs.

Figure 1 Ascend C programming class library APIs

Basic APIs are classified into the following types:

Compute APIs involve the following computation methods based on data operation methods:

The following figure uses vector addition as an example to show the characteristics of these computation methods.

Figure 2 Characteristics of computation methods of compute APIs

Header file directory of Ascend C APIs:

  • Basic APIs: ${DDK_INSTALL_PATH}/tools/tools_ascendc/include/tikcpp/tikcfw/kernel_operator.h

  • High-level APIs: ${DDK_INSTALL_PATH}/tools/tools_ascendc/include/tikcpp/tikcfw/lib, where ${DDK_INSTALL_PATH} indicates the installation directory of the DDK. (Note that if the APIs contained in the header file directory are not declared in the documentation, they are called indirectly, and you do not need to pay attention to them.)