AIE APIs are header files allowing a higher level of abstraction than intrinsics. They are also architecture-agnostic meaning the generated intrinsics match the selected target device. Browse through the AI Engine API User Guide to view the available functions (Figure 3).
Figure 3: AI Engine API User Guide
The following figure shows how an intrinsic and an API with the same basic operation, such as multiply accumulate can differ.
Figure 4: Intrinsic vs. API
Note: Intrinsics have more parameters, allowing more flexibility, but require more detailed knowledge of the architecture. APIs assume a specific use-case, allowing the use of fewer parameters.
The use of APIs is highly recommended. Use only intrinsics to optimize critical portions of the code. Note that intrinsics and APIs can mix together in the same kernel code.