|
AI Engine API User Guide (AIE-API) 2025.1
|
These functions provide a semi-portable interface to pin variables, such as vectors, accumulators, masks, and pointers, to a given register/set of registers.
Functions | |
| template<unsigned Reg = (unsigned)-1, AIE_RegFile RegFile = AIE_RegFile::Default, typename T> | |
| auto | aie::utils::locate_in_register (T &&val) |
| Binds a value to a specified register. | |
| template<unsigned StartIdx = 0, unsigned N, AIE_RegFile RegFile = AIE_RegFile::Default, typename T> | |
| void | aie::utils::locate_in_register (T(&arr)[N]) |
| Binds each variable in an array to sequential registers, starting from the specified register. | |
| auto aie::utils::locate_in_register | ( | T && | val | ) |
Binds a value to a specified register.
The type and size of the value determines the type of register and the template parameter Reg selects which specific register to bind it to.
| Reg | Numeric identifier of the register the value will be bound to. |
| RegFile | Register file to locate the value. |
| val | The value to be pinned. This may be an aie::vector, aie::accum, or scalar value. |
Example:
This will bind v to register x4 on AIE-ML:
Reg template parameter is set to 4.v is a vector of 512bit, so it will bind to a x 512bit vector register. | void aie::utils::locate_in_register | ( | T(&) | arr[N] | ) |
Binds each variable in an array to sequential registers, starting from the specified register.
| Reg | Numeric identifier of register to bind the first variable to. |
| RegFile | Which register file to locate the variable in. |
| arr | The value to be placed. This may be an aie::vector, aie::accum, or scalar value. |
Example:
This will bind vs[0] to x4, vs[1] to x5 and vs[2] to x6 on AIE-ML.