Single-Operator API Execution

  • In addition to the calling mode of single-operator API execution described in this chapter, AscendCL also provides the calling mode of single-operator model execution. For details, see Single-Operator Calling Modes.
  • Scenarios (such as product models, data types, and data formats) that are not specified in the API document are not recommended. The current version does not guarantee the calling effect.

This chapter describes the operator APIs listed in Table 1, including the API prototype, function description, parameter description, and calling examples.

For details about the operator API calling process, see API Call Sequence of Single-Operator API Execution. For the calling example (using the NN operator), see Sample Code for Calling NN or Fused Operator APIs.

Table 1 Single-operator execution APIs

API Category

Description

How to Obtain

NN operator

Neural network operators, which are the built-in basic CANN operators and cover the calculation types related to deep learning algorithms in frameworks such as TensorFlow, PyTorch, MindSpore, and ONNX, including typical calculations such as Softmax, MatMul, and Convolution. The API prefix is aclnnXxx.

For details, see "NN Operator APIs" in Operator Acceleration Library API Reference.

Fusion operator

Built-in fused operators of CANN. The API prefix is aclnnXxx. They are large operators that combine multiple independent small operators (such as vectors and cubes). The functions of multiple small operators are equivalent to those of the large operator, large operators outperform small operators in terms of performance or memory. The common large operators include Flash Attention and MC2 operators.

NOTE:

In addition to the fusion operators provided in this document, you can also click the link to access the Gitee cann-ops-adv repository to obtain the fusion operators whose code is open.

Currently, the fused operators do not support Ascend virtualization instances.

For details, see "Fusion Operator APIs" in Operator Acceleration Library API Reference.

DVPP operator

The prefix of the Digital Vision Pre-Processing operator APIs is acldvppXxx. These preprocessing APIs can be used for high-performance video/image encoding and decoding and image cropping and resizing.

For details, see "DVPP Operator APIs" in Operator Acceleration Library API Reference.