AI Engine API User Guide (AIE) 2023.2
|
Vector Initialization
On construction, the contents of a vector are undefined.
The simplest way of initializing a vector is from another vector of the same type and size.
Or as the result of an operation.
A vector can also be read from memory using the aie::load_v operation or iterators. See Memory for more details.
Sections of a vector can be modified independently. It can be done in a per-element basis.
Or by writing subvectors.
Vectors can also be concatenated into a larger vector.
Accumulator Initialization
Accumulators support all the aforementioned vector operations but the individual element update.
Initialization by Stream Read
Both vectors and accumulators can also be read from ADF abstractions such as windows and streams. See Interoperability with Adaptive Data Flow (ADF) Graph Abstractions for more details.
Mask Initialization
Masks are usually initialized as a result of a comparison using vectors:
In addition, it is possible to initialize a mask using a constant value. For example:
- Tip:
- You can use the standard C/C++ macros for fixed-sized integers instead of the integer suffix. In the definition of
m1
it would look likeUINT64_C(0xaaaabbbbccccdddd)
.