Header Files and Library Files
CANN app development involves the APIs provided by components such as Runtime, Graph Engine (GE), and Digital Vision Pre-Processing (DVPP). For details about the APIs provided by each component, see the API reference of each component. This section only describes the API categories and the header files and library files that the APIs depend on.
API Categories
The API names are prefixed with acl and in the format of acl+API category abbreviation+*. The asterisk (*) generally indicates the operation verb and object, both of which are capitalized. In this document, APIs are referred to as acl APIs.
In acl APIs, the parameters are usually arranged in the sequence of input parameters followed by output parameters. You should not add new parameters to the end of an API. Instead, you should add new parameters that are used only as input parameters before the output parameters. For parameters that are used as both input and output, the situation is relatively complex. You may need to consider the consistency with other APIs and handle the parameters flexibly.
API Prefix |
Description |
Component |
|---|---|---|
acl |
System configuration APIs |
Runtime |
aclrt |
Runtime management APIs |
Runtime |
aclop |
Single-operator model execution APIs |
Runtime |
aclblas |
BLAS APIs |
Graph Engine |
aclmdl |
Model inference APIs |
Graph Engine |
acldvpp, aclvdec, or aclvenc |
Media data processing APIs The naming conventions are not applicable to media data processing V2 APIs that start with hi_mpi. |
DVPP |
aclprof |
Profiling configuration APIs |
Runtime |
acltdt |
Data transmission APIs |
Runtime |
aclfv |
Feature vector search APIs |
Feature Vector |
Due to software and hardware differences, the supported API categories vary with the product model. For details, see the description of each API.
Header Files and Library Files Required by APIs
After installing the firmware, drivers, and the CANN software package, you can include the acl API's required header files and library files only when compiling and running your apps.
The header files of acl APIs are stored in the ${INSTALL_DIR}/include/ directory, and the library files are stored in the ${INSTALL_DIR}/lib64/ directory. 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.
You need to include the dependent header files based on the acl APIs to be called. Refer to the table below for details about the header files.
When building code based on acl APIs, include the corresponding library files based on the included header files. If redundant .so files (such as libascendcl.a) are referenced, version functions may be abnormal or there may be compatibility issues during a version update.
Header File |
Function |
Corresponding Library File |
|---|---|---|
acl/acl_rt.h |
Declares APIs for initialization/deinitialization, device management, context management, stream management, synchronization, memory management, and more. |
libacl_rt.so libascendcl.so is used in earlier versions. However, it will no longer be available in later versions. To avoid compatibility issues, you are advised to use libacl_rt.so. |
acl/acl_dump.h |
Declares model and operator dump APIs. |
libascend_dump.so |
acl/acl_prof.h |
Declares profiling APIs. |
libmsprofiler.so libascendcl.so is used in earlier versions. However, it will no longer be available in later versions. To avoid compatibility issues, you are advised to use libmsprofiler.so. |
acl/acl_tdt.h |
Declares APIs for tensor data transfer. |
libacl_tdt_channel.so |
acl/acl_tdt_queue.h |
Declares APIs for shared queue management and shared buffer management. |
libacl_tdt_queue.so |
acl/acl_rt_api.h |
Declares C++ extension APIs that provide function overloading and template-based wrappers (for C++ programs only). It depends on acl_rt.h. |
libacl_rt.so |
Header File |
Function |
Matching Library File |
|---|---|---|
acl/acl_mdl.h |
Declares the model management APIs. |
libacl_mdl.so libascendcl.so is supported in earlier versions to avoid compatibility issues. However, it will not be supported in later versions. Therefore, you are advised to use libacl_mdl.so to ensure compatibility with later versions. |
acl/acl_op.h acl/acl_op_compiler.h |
Declares single-operator calling APIs (including only single-operator model execution APIs). |
libacl_op_executor.so libacl_op_compiler.so libascendcl.so is supported in earlier versions to avoid compatibility issues. However, it will be removed in later versions. Therefore, you are advised to use libacl_op_executor.so and libacl_op_compiler.so to ensure compatibility with later versions. |
acl/ops/acl_cblas.h |
Declares the CBLAS APIs. |
libacl_cblas.so |
Category |
Header File |
Function |
Matching Library File |
|---|---|---|---|
Media data processing operator |
In the acldvppop directory: acldvpp_base.h acldvpp_op_api.h |
Declares the functional APIs of DVPP operators. |
libacl_dvpp_op.so |
Media data processing operator |
In the aclnn directory: acl_meta.h aclnn_base.h |
Declares common meta APIs such as those for creating aclTensor, aclScalar, and aclIntArray. |
libnnopbase.so |
Media data processing V2 |
acl/dvpp/hi_dvpp.h |
Declares the DVPP APIs in media data processing V2. |
libacl_dvpp_mpi.so |
Media data processing V2 |
In the acl/media directory: hi_mpi_vi.h hi_common_vi.h hi_common_dis.h hi_common_gdc.h hi_media_common.h hi_media_type.h hi_mpi_sys.h |
Declares the video input (VI) data obtaining APIs. |
libacl_vi_mpi.so libacl_dvpp_mpi.so |
Media data processing V2 |
In the acl/media directory: hi_mpi_isp.h hi_common_isp.h hi_common_3a.h hi_mpi_ae.h hi_common_ae.h hi_mpi_awb.h hi_common_awb.h hi_common_sns.h hi_media_common.h hi_media_type.h hi_mpi_sys.h |
Declares the image signal processing (ISP) system control APIs. |
libacl_isp_ae_mpi.so libacl_isp_awb_mpi.so libacl_isp_mpi.so libacl_dvpp_mpi.so |
Media data processing V2 |
In the acl/media directory: hi_mpi_vpss.h hi_media_common.h hi_media_type.h hi_mpi_sys.h |
Declares the video process sub-system (VPSS) image processing APIs. |
libacl_vpss_mpi.so libacl_dvpp_mpi.so |
Media data processing V2 |
acl/media/hi_mipi_rx.h |
Declares the MIPI RX ioctl command words. |
- |
Media data processing V2 |
In the acl/media directory: hi_mpi_audio.h hi_common_aio.h |
Declares the audio input and output APIs. |
libacl_audio_mpi.so |
Media data processing V2 |
acl/media/hi_acodec.h |
Declares the volume adjustment command word. |
- |
Media data processing V2 |
In the acl/media directory: hi_common_vo.h hi_mpi_vo.h |
Declares the video output APIs. |
libacl_vo_mpi.so |
Media data processing V2 |
acl/media/hi_mpi_hdmi.h |
Declares the HDMI APIs for connecting to peripherals. |
libacl_hdmi_mpi.so |
Media data processing V2 |
acl/media/hi_mpi_tde.h |
Declares the TDE APIs for graphics drawing. |
libacl_tde_mpi.so |
Media data processing V2 |
acl/media/hifb.h |
Declares APIs for managing overlaid graphics layers. |
- |
Media data processing V1 |
acl/ops/acl_dvpp.h |
Declares the media data processing V1 APIs. |
libacl_dvpp.so |
Header File |
Function |
Matching Library File |
|---|---|---|
acl/ops/acl_fv.h |
Declares the feature vector search APIs. |
libacl_retr.so |