AI Engine API User Guide (AIE) 2021.2
aie::detail::accum< Class, MinBits, Elems > Class Template Reference

#include

Public Types

using value_type=accum_tag_t< Class, MinBits >

Public Member Functions

accum()
More...
template
accum(constaccum< Class, MinBits2, Elems > &acc)
More...
accum(const storage_t &data)
More...
template
accum(constvector< T, Elems > &v, intshift=0)
More...
template
auto cast_to() const
More...
template
accum< Class, Bits, ElemsOut > extract(unsigned idx) const
More...
template
void from_vector(constvector< T, Elems > &v, intshift=0)
More...
template
accum< Class, Bits, ElemsOut > grow() const
More...
template
accum< Class, Bits, ElemsOut > grow_extract(unsigned idx) const
template
accum& insert(unsigned idx, constaccum< Class, Bits, ElemsIn > &acc)
More...
template
accum& insert(unsigned idx, typenameaccum< Class, Bits, ElemsIn >::native_type acc)
More...
operator storage_t() const
More...
operator vector< cfloat, Elems >() const
More...
operator vector< float, Elems >() const
More...
template
accum& operator=(constvector< T, Elems > &v)
More...
auto to_native() const
More...
auto to_vector() const
More...
template
vector< T, Elems > to_vector(intshift=0) const
More...
template
vector< T, Elems > to_vector_zip(intshift=0) const
More...
template
void upd_all(const SubAccums &...subaccums)
More...

Static Public Member Functions

static constexpr unsigned bits()
More...
static constexpr bool is_complex()
More...
static constexpr bool is_real()
More...
static constexpr unsigned size()
More...
static constexprAccumClass value_class()
More...

Public Attributes

storage_t data

Constructor & Destructor Documentation

accum()[1/4]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
aie::detail::accum< Class, MinBits, Elems >::accum ( )
inline

Default constructor. The value of the elements is undefined.

accum()[2/4]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
aie::detail::accum< Class, MinBits, Elems >::accum ( constaccum< Class, MinBits2, Elems > & acc )
inline

Copy constructor.

accum()[3/4]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
aie::detail::accum< Class, MinBits, Elems >::accum ( const storage_t & data )
inline

Construct from internal native types.

Parameters
data Data used to construct the accumulator from.

accum()[4/4]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
aie::detail::accum< Class, MinBits, Elems >::accum ( constvector< T, Elems > & v,
int shift=0
)
inlineexplicit

Construct from a vector. The accumulator class and the vector type must be compatible. The accumulator size and the vector size must be the same.

Parameters
v Data used to construct the accumulator from.
shift Upshift value.

Member Function Documentation

bits()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
static constexpr unsignedaie::detail::accum< Class, MinBits, Elems >::bits ( )
inlinestaticconstexpr

Returns the total size of the accumulator in bits.

cast_to()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
autoaie::detail::accum< Class, MinBits, Elems >::cast_to ( ) const
inline

Reinterprets the current accumulator as an accumulator of the given type. The number of elements is automatically computed by the function

Template Parameters
DstTag Type the accumulator will be cast to

extract()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
accumaie::detail::accum< Class, MinBits, Elems >::extract ( unsigned idx ) const
inline

Returns a subaccumulator with the contents of a region of the accumulator.

Template Parameters
ElemsOut Size of the returned subaccumulator.
Parameters
idx Index of the subaccumulator to be returned.

from_vector()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
voidaie::detail::accum< Class, MinBits, Elems >::from_vector ( constvector< T, Elems > & v,
int shift=0
)
inline

Updates the contents of the accumulator using the values in the given vector after applying the requested upshift operation.

Parameters
v Input vector.
shift Number of bits to be upshifted.

grow()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
accumaie::detail::accum< Class, MinBits, Elems >::grow ( ) const
inline

Returns a copy of the current accumulator in a larger accumulator. The value of the new elements is undefined.

Template Parameters
ElemsOut Size of the output accumulator.

insert()[1/2]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
accum&aie::detail::accum< Class, MinBits, Elems >::insert ( unsigned idx,
constaccum< Class, Bits, ElemsIn > & acc
)
inline

Updates the contents of a region of the accumulator using the values in the given native subaccumulator and returns a reference to the updated accumulator.

Parameters
idx Index of the subaccumulator to be replaced.
acc Native subaccumulator to be written into the region.

insert()[2/2]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
accum&aie::detail::accum< Class, MinBits, Elems >::insert ( unsigned idx,
typenameaccum< Class, Bits, ElemsIn >::native_type acc
)
inline

Updates the contents of a region of the accumulator using the values in the given native subaccumulator and returns a reference to the updated accumulator.

Parameters
idx Index of the subaccumulator to be replaced.
acc Native subaccumulator to be written into the region.

is_complex()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
static constexpr boolaie::detail::accum< Class, MinBits, Elems >::is_complex ( )
inlinestaticconstexpr

Returns a bool that says whether the element class is a complex number.

is_real()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
static constexpr boolaie::detail::accum< Class, MinBits, Elems >::is_real ( )
inlinestaticconstexpr

Returns a bool that says whether the element class is a real number.

operator storage_t()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
aie::detail::accum< Class, MinBits, Elems >::operator storage_t ( ) const
inline

Operator for conversion to the internal underlying type. If the number of internal subaccumulators is 1, this type matches the native type.

operator vector< cfloat, Elems >()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
aie::detail::accum< Class, MinBits, Elems >::operatorvector< cfloat, Elems > ( ) const
inline

Operator for conversion of complex FP32 accumulators to a vector of the same type.

operator vector< float, Elems >()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
aie::detail::accum< Class, MinBits, Elems >::operatorvector< float, Elems > ( ) const
inline

Operator for conversion of FP32 accumulators to a vector of the same type.

operator=()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
accum&aie::detail::accum< Class, MinBits, Elems >::operator= ( constvector< T, Elems > & v )
inline

Updates the contents of the accumulator using the values in the given vector. No upshift is applied.

Parameters
v Input vector.

size()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
static constexpr unsignedaie::detail::accum< Class, MinBits, Elems >::size ( )
inlinestaticconstexpr

Returns the number of elements in the accumulator.

to_native()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
autoaie::detail::accum< Class, MinBits, Elems >::to_native ( ) const
inline

Returns the native type of the accumulator. Only valid when the number of subaccumulators is 1.

to_vector()[1/2]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
autoaie::detail::accum< Class, MinBits, Elems >::to_vector ( ) const
inline

Returns the values of the FP32 accumulator in a vector of the requested type.

to_vector()[2/2]

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
vectoraie::detail::accum< Class, MinBits, Elems >::to_vector ( int shift=0 ) const
inline

Returns the values of the accumulator in a vector of the requested type, after applying the requested shift-round-saturate operation.

Parameters
shift Number of bits that need to be downshifted.

to_vector_zip()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
vectoraie::detail::accum< Class, MinBits, Elems >::to_vector_zip ( int shift=0 ) const
inline

Returns the values of the accumulator in a vector of the requested type, after applying the requested shift-round-saturate operation. The values are interleaved as if the accumulator would be split in two parts and zipped.

Parameters
shift Number of bits that need to be downshifted.

upd_all()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
template
voidaie::detail::accum< Class, MinBits, Elems >::upd_all ( const SubAccums &... subaccums )
inline

Updates the contents of the accumulator using the values in the given subaccumulators. Subaccumulators must be of the same class and size.

Parameters
subaccums List of subaccumulators.

value_class()

template< AccumClassClass, unsigned MinBits, unsigned Elems>
static constexprAccumClassaie::detail::accum< Class, MinBits, Elems >::value_class ( )
inlinestaticconstexpr

Returns the class of the accumulator elements.


The documentation for this class was generated from the following files: