AI Engine API User Guide (AIE) 2022.1
|
Type with functionality to directly index a LUT based on input vector of values.
Input | LUT values |
---|---|
int8 | int8 int16 |
int16 | bfloat16/>int32 |
T | Type of the input vector, containing values used to index the lookup table. |
MyLUT | Definition of the LUT type, using the lut type |
oor_policy | Defines 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... | |
|
inline |
Constructor, configures aspects of how the lookup is performed.
l | LUT containing the stored values used for the linear approximation. |
step_bits | Optional lower bits that will be ignored for indexing the LUT. |
bias | Optional offset added to the input values used to index, for example to center on 0 by adding half the number of LUT elements. |
|
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
input | Vector of input values that are used to index the look-up table. |