AI Engine API User Guide (AIE) 2022.2
Floating-point Conversion

Overview

Functions

template<typename TR = cint32>
auto aie::to_fixed (cfloat a, int shift=0)
  More...
 
template<typename TR = cint32, unsigned Elems = 0>
auto aie::to_fixed (const vector< cfloat, Elems > &v, int shift=0) -> vector< TR, Elems >
  More...
 
template<typename TR = int32, unsigned Elems = 0>
auto aie::to_fixed (const vector< float, Elems > &v, int shift=0) -> vector< TR, Elems >
  More...
 
template<typename TR = int32>
auto aie::to_fixed (float a, int shift=0)
  More...
 
template<typename T , unsigned Elems>
auto aie::to_float (const vector< T, Elems > &v, int shift=0)
  More...
 
template<Elem E>
auto aie::to_float (E a, int shift=0)
  More...
 

Function Documentation

◆ to_fixed() [1/4]

template<typename TR = cint32>
auto aie::to_fixed ( cfloat  a,
int  shift = 0 
)

Convert a floating point value into a fixed-point value.

Parameters
aInput value.
shiftPosition of the point in the output value.
Template Parameters
TRType of the returned fixed-point value.

◆ to_fixed() [2/4]

template<typename TR = cint32, unsigned Elems = 0>
auto aie::to_fixed ( const vector< cfloat, Elems > &  v,
int  shift = 0 
) -> vector<TR, Elems>

Convert the elements in a floating point vector into fixed-point values.

Parameters
vInput vector.
shiftPosition of the point in the output values.
Template Parameters
TRType of the returned fixed-point values.

◆ to_fixed() [3/4]

template<typename TR = int32, unsigned Elems = 0>
auto aie::to_fixed ( const vector< float, Elems > &  v,
int  shift = 0 
) -> vector<TR, Elems>

Convert the elements in a floating point vector into fixed-point values.

Parameters
vInput vector.
shiftPosition of the point in the output values.
Template Parameters
TRType of the returned fixed-point values.

◆ to_fixed() [4/4]

template<typename TR = int32>
auto aie::to_fixed ( float  a,
int  shift = 0 
)

Convert a floating point value into a fixed-point value.

Parameters
aInput value.
shiftPosition of the point in the output value.
Template Parameters
TRType of the returned fixed-point value.

◆ to_float() [1/2]

template<typename T , unsigned Elems>
auto aie::to_float ( const vector< T, Elems > &  v,
int  shift = 0 
)

Convert the elements in a fixed-point vector into floating point values.

Parameters
vInput vector.
shiftPosition of the point in the input values.

◆ to_float() [2/2]

template<Elem E>
auto aie::to_float ( a,
int  shift = 0 
)

Convert a a fixed-point value into a floating point value.

Parameters
aInput value.
shiftPosition of the point in the input value.