AI Engine API User Guide (AIE-API) 2025.1
Loading...
Searching...
No Matches

Overview

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.
 

Function Documentation

◆ locate_in_register() [1/2]

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.

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.

Template Parameters
RegNumeric identifier of the register the value will be bound to.
RegFileRegister file to locate the value.
Parameters
valThe value to be pinned. This may be an aie::vector, aie::accum, or scalar value.

Example:

Type for vector registers.
Definition vector.hpp:78
auto locate_in_register(T &&val)
Binds a value to a specified register.
Definition utils.hpp:831

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.

◆ locate_in_register() [2/2]

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.

Template Parameters
RegNumeric identifier of register to bind the first variable to.
RegFileWhich register file to locate the variable in.
Parameters
arrThe 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.

See also
locate_in_register(T&&)