If single-operator execution is involved, your app must contain the related code logic. For details about the API call sequence, see API Call Sequence and then this section.
For details about the operators supported by the system, see Operator Lists.
For operators that are not supported by the system, you need to develop custom operators by referring to Operator Developer Guide.
For TIK custom dynamic-shape operators, you need to register an operator selector first. For details, see Executing a Dynamic-Shape Operator (Operator Selector Registered).
Operators can be compiled in either of the following modes:
In this mode, you need to use the ATC tool to compile the operator. For details, see ATC Instructions. Compile the single-operator definition file (.json) into an offline model adapted to the Ascend AI Processor (.om file).
After the compilation, perform 2, 3, 5, 6, and 7 in sequence.
In this mode, you need to call AscendCL APIs as required.
To transfer data from the host to the device, call aclrtMemcpy (synchronous mode) or aclrtMemcpyAsync (asynchronous mode) to copy the memory.
You need to call the aclopInferShape, aclGetTensorDescNumDims, aclGetTensorDescDimV2, and aclGetTensorDescDimRange APIs to infer or estimate the output shape of the operator as the input of the operator execution API aclopExecuteV2.
If an operator is executed in non-handle mode, the system matches the model in the memory based on the operator description in every execution.
If an operator is executed in handle mode, the system matches the model in the memory based on the operator description, and caches it in the handle. The handle mode boosts the efficiency in scenarios where the same operator is executed for multiples times. Call aclopDestroyHandle to destroy the handle when it is no longer needed.
Call aclrtMemcpy (synchronous mode) or aclrtMemcpyAsync (asynchronous mode) to transfer data from the device to the host via memory copy.