AI Engine API User Guide (AIE) 2022.1
aie::parallel_lookup< T, MyLUT, oor_policy > Struct Template Reference

Detailed Description

template<typename T, ParallelLUT MyLUT, lut_oor_policy oor_policy = lut_oor_policy::saturate>
struct aie::parallel_lookup< T, MyLUT, oor_policy >

Type with functionality to directly index a LUT based on input vector of values.

Supported types
InputLUT values
int8int8
int16
int16bfloat16/>int32
Template Parameters
TType of the input vector, containing values used to index the lookup table.
MyLUTDefinition of the LUT type, using the lut type
oor_policyDefines the "out of range policy" for when index values on the input go beyond the size of the LUT. It can either saturate taking on the max/min value or truncate retaining the lower bits. Saturating is the default behaviour, but for certain non-linear functions which repeat after an interval you may want to truncate.

#include <aie.hpp>

Public Member Functions

 parallel_lookup (const MyLUT &l, unsigned step_bits=0, int bias=0)
  More...
 
template<Vector Vec>
vector< typename MyLUT::offset_type, Vec::size()> fetch (const Vec &input)
  More...
 

Constructor & Destructor Documentation

◆ parallel_lookup()

template<typename T , ParallelLUT MyLUT, lut_oor_policy oor_policy = lut_oor_policy::saturate>
aie::parallel_lookup< T, MyLUT, oor_policy >::parallel_lookup ( const MyLUT &  l,
unsigned  step_bits = 0,
int  bias = 0 
)
inline

Constructor, configures aspects of how the lookup is performed.

Parameters
lLUT containing the stored values used for the linear approximation.
step_bitsOptional lower bits that will be ignored for indexing the LUT.
biasOptional offset added to the input values used to index, for example to center on 0 by adding half the number of LUT elements.

Member Function Documentation

◆ fetch()

template<typename T , ParallelLUT MyLUT, lut_oor_policy oor_policy = lut_oor_policy::saturate>
template<Vector Vec>
vector<typename MyLUT::offset_type, Vec::size()> aie::parallel_lookup< T, MyLUT, oor_policy >::fetch ( const Vec &  input)
inline

Accesses the lookup table based on the provided input values, will return a vector of the same number of elements as the input vector.
Input values are interpreted from MSB to LSB: headroom | LUT elements | step_bits

Parameters
inputVector of input values that are used to index the look-up table.

The documentation for this struct was generated from the following file: