Overview

This section uses the Add operator as an example to help you quickly build an Ascend C vector operator program and learn the typical scenarios and processing methods of vector operator development. The following scenarios are involved:

During data movement and vector computation, the length of the moved data and the start address of the operand must meet the following alignment requirements:

  • When the DataCopy API is used to move data, the length of the moved data and the start address of the operand (on Unified Buffer) must be 32-byte aligned.
  • Generally, during vector computation, the start address of the operand must be 32-byte aligned, and the basic unit for the computation is 32 bytes.