![]() |
AI Engine API User Guide (AIE) 2021.2
|
#include <accum.hpp>
Public Types | |
| using | value_type = accum_tag_t< Class, MinBits > |
Public Member Functions | |
| accum () | |
| More... | |
| template<unsigned MinBits2> | |
| accum (const accum< Class, MinBits2, Elems > &acc) | |
| More... | |
| accum (const storage_t &data) | |
| More... | |
| template<typename T > | |
| accum (const vector< T, Elems > &v, int shift=0) | |
| More... | |
| template<typename DstTag > | |
| auto | cast_to () const |
| More... | |
| template<unsigned ElemsOut> | |
| accum< Class, Bits, ElemsOut > | extract (unsigned idx) const |
| More... | |
| template<typename T > | |
| void | from_vector (const vector< T, Elems > &v, int shift=0) |
| More... | |
| template<unsigned ElemsOut> | |
| accum< Class, Bits, ElemsOut > | grow () const |
| More... | |
| template<unsigned ElemsOut> | |
| accum< Class, Bits, ElemsOut > | grow_extract (unsigned idx) const |
| template<unsigned ElemsIn> | |
| accum & | insert (unsigned idx, const accum< Class, Bits, ElemsIn > &acc) |
| More... | |
| template<unsigned ElemsIn> | |
| accum & | insert (unsigned idx, typename accum< 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<typename T > | |
| accum & | operator= (const vector< T, Elems > &v) |
| More... | |
| auto | to_native () const |
| More... | |
| auto | to_vector () const |
| More... | |
| template<typename T > | |
| vector< T, Elems > | to_vector (int shift=0) const |
| More... | |
| template<typename T > | |
| vector< T, Elems > | to_vector_zip (int shift=0) const |
| More... | |
| template<typename... SubAccums> | |
| 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 constexpr AccumClass | value_class () |
| More... | |
Public Attributes | |
| storage_t | data |
|
inline |
Default constructor. The value of the elements is undefined.
|
inline |
Copy constructor.
|
inline |
Construct from internal native types.
| data | Data used to construct the accumulator from. |
|
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.
| v | Data used to construct the accumulator from. |
| shift | Upshift value. |
|
inlinestaticconstexpr |
Returns the total size of the accumulator in bits.
|
inline |
Reinterprets the current accumulator as an accumulator of the given type. The number of elements is automatically computed by the function
| DstTag | Type the accumulator will be cast to |
|
inline |
Returns a subaccumulator with the contents of a region of the accumulator.
| ElemsOut | Size of the returned subaccumulator. |
| idx | Index of the subaccumulator to be returned. |
|
inline |
Updates the contents of the accumulator using the values in the given vector after applying the requested upshift operation.
| v | Input vector. |
| shift | Number of bits to be upshifted. |
|
inline |
Returns a copy of the current accumulator in a larger accumulator. The value of the new elements is undefined.
| ElemsOut | Size of the output accumulator. |
|
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.
| idx | Index of the subaccumulator to be replaced. |
| acc | Native subaccumulator to be written into the region. |
|
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.
| idx | Index of the subaccumulator to be replaced. |
| acc | Native subaccumulator to be written into the region. |
|
inlinestaticconstexpr |
Returns a bool that says whether the element class is a complex number.
|
inlinestaticconstexpr |
Returns a bool that says whether the element class is a real number.
|
inline |
Operator for conversion to the internal underlying type. If the number of internal subaccumulators is 1, this type matches the native type.
|
inline |
Operator for conversion of complex FP32 accumulators to a vector of the same type.
|
inline |
Operator for conversion of FP32 accumulators to a vector of the same type.
|
inline |
Updates the contents of the accumulator using the values in the given vector. No upshift is applied.
| v | Input vector. |
|
inlinestaticconstexpr |
Returns the number of elements in the accumulator.
|
inline |
Returns the native type of the accumulator. Only valid when the number of subaccumulators is 1.
|
inline |
Returns the values of the FP32 accumulator in a vector of the requested type.
|
inline |
Returns the values of the accumulator in a vector of the requested type, after applying the requested shift-round-saturate operation.
| shift | Number of bits that need to be downshifted. |
|
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.
| shift | Number of bits that need to be downshifted. |
|
inline |
Updates the contents of the accumulator using the values in the given subaccumulators. Subaccumulators must be of the same class and size.
| subaccums | List of subaccumulators. |
|
inlinestaticconstexpr |
Returns the class of the accumulator elements.