目录

Compatibility

For details about the overall compatibility policies, see Table 1 Ascend C API compatibility policies. The compatibility scope does not include built-in APIs of the compiler and internal APIs of Ascend C. If you want to run Ascend C programs developed on other platforms on a new platform, you need to recompile and run the programs on the new platform, and may need to adjust the code according to the porting guide.

Figure 1 Ascend C API hierarchy

Table 1 Ascend C API compatibility policies

API Level Compatibility Policy
High-level APIs High-level APIs are compatible with all architectures, but are incompatible with some domain-specific features.
Basic API Basic APIs are classified into compatible APIs and ISASI APIs. Compatible APIs are compatible with all architectures. ISASI APIs, such as the compute APIs LoadData and Mmad on the Cube, are architecture-related APIs and their compatibility across architecture versions is not guaranteed.
Framework APIs Framework APIs are implemented through software and compatible across architecture versions.
Language extension C APIs Compatibility is not guaranteed.
Compiler built-in APIs Compatibility is not guaranteed.

Brief Description

  1. To ensure compatibility, you are advised to avoid using the following APIs or programming methods during development. Otherwise, you need to ensure compatibility by yourself.

    • Non-Ascend C public APIs and structures, such as those in the impl directory.
    • Hardcode of the chip specifications. Examples:
      uint32_t MAX_UB_SIZE = 256 * 1024;
      // Recommended obtaining method: ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, MAX_UB_SIZE);
      // ...
    • Compiler built-in APIs. Examples:
      copy_gm_to_ubuf(input_1_local_ub, input_1, 0, 1, 8, 0, 0);
    • TilingKey programming.
  2. You are advised to use the following APIs or programming methods: