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

Detailed Description

template
class aie::detail::vector< T, Elems >

Implementation of the vector data type

Template Parameters
T Type of the elements contained in the vector.
Elems Number of elements in the vector.

#include

Public Types

using native_type=native_vector_type_t< T, Elems >
using value_type= T

Public Member Functions

vector()
More...
vector(constnative_type&v)
More...
vector(constvector_storage_t< T, Elems > &v)
More...
template
vector(value_typev, Values &&... values)
More...
template
auto cast_to() const
More...
constexprvector_elem_const_ref<value_type, Elems > elem_const_ref(unsigned idx) const
More...
constexprvector_elem_ref<value_type, Elems > elem_ref(unsigned idx)
More...
constexprvector_elem_const_ref<value_type, Elems > elem_ref(unsigned idx) const
More...
template
vector<value_type, ElemsOut > extract(unsigned idx) const
More...
value_type get(unsigned idx) const
More...
template
constexprvector< T, ElemsOut > grow(unsigned idx=0) const
More...
template
vector<value_type, ElemsOut > grow_extract(unsigned idx) const
template
constexprvector< T, ElemsOut > grow_replicate() const
More...
template
vector& insert(unsigned idx, constvector< T, ElemsIn > &v)
More...
template
vector& insert(unsigned idx, typenamevector< T, ElemsIn >::native_typev)
More...
template<aie_dm_resourceResource, typename T2 >
void load(const T2 *ptr)
More...
template<aie_dm_resourceResource, typename T2 >
void load_unaligned(const T2 *ptr, unsigned aligned_elems)
More...
operator native_type() const
More...
constexprvector_elem_ref<value_type, Elems > operator[](unsigned idx)
More...
constexprvector_elem_const_ref<value_type, Elems > operator[](unsigned idx) const
More...
template
vector< T2, Elems > pack() const
More...
vector& push(value_typev)
More...
template
constexprvector_ref<value_type, RefElems, Elems > ref(unsigned off=0)
void set(value_typev, unsigned idx)
More...
template
auto split() const
More...
template<aie_dm_resourceResource, typename T2 >
void store(T2 *ptr) const
More...
template<aie_dm_resourceResource, typename T2 >
void store_unaligned(T2 *ptr, unsigned aligned_elems) const
More...
auto to_native() const
vector<int16, Elems > unpack() const
More...
template
vector& upd_all(SubVectors &&...subvectors)
More...

Static Public Member Functions

static constexpr unsigned bits()
More...
static constexpr bool is_complex()
More...
static constexpr bool is_floating_point()
More...
static constexpr bool is_integral()
More...
static constexpr bool is_real()
More...
static constexpr bool is_signed()
More...
static constexpr unsigned size()
More...

Friends

template
class vector
More...

Constructor & Destructor Documentation

vector()[1/4]

template
aie::detail::vector< T, Elems >::vector ( )
inline

Default constructor. The value of the elements is undefined.

vector()[2/4]

template
aie::detail::vector< T, Elems >::vector ( constvector_storage_t< T, Elems > & v )
inline

Construct from internal native types.

Parameters
v Data used to construct the vector from.

vector()[3/4]

template
aie::detail::vector< T, Elems >::vector ( constnative_type& v )
inline

Construct from internal types. This is a special case for 1024b internal vector types, which need to be broken into two 512b vectors

Parameters
v Data used to construct the vector from

vector()[4/4]

template
template
aie::detail::vector< T, Elems >::vector ( value_type v,
Values &&... values
)
inlineexplicit

Construct from a list of values

Parameters
v First value in the list
values Rest of values in the list

Member Function Documentation

bits()

template
static constexpr unsignedaie::detail::vector< T, Elems >::bits ( )
inlinestaticconstexpr

Returns the total size of the vector in bits.

cast_to()

template
template
autoaie::detail::vector< T, Elems >::cast_to ( ) const
inline

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

Template Parameters
DstT Type the vector will be cast to

elem_const_ref()

template
constexprvector_elem_const_ref<value_type, Elems>aie::detail::vector< T, Elems >::elem_const_ref ( unsigned idx ) const
inlineconstexpr

Returns a constant reference object to the element on the given index.

Parameters
idx Index of the element.

elem_ref()[1/2]

template
constexprvector_elem_ref<value_type, Elems>aie::detail::vector< T, Elems >::elem_ref ( unsigned idx )
inlineconstexpr

Returns a reference object to the element on the given index.

Parameters
idx Index of the element.

elem_ref()[2/2]

template
constexprvector_elem_const_ref<value_type, Elems>aie::detail::vector< T, Elems >::elem_ref ( unsigned idx ) const
inlineconstexpr

Returns a constant reference object to the element on the given index.

Parameters
idx Index of the element.

extract()

template
template
vector<value_type, ElemsOut>aie::detail::vector< T, Elems >::extract ( unsigned idx ) const
inline

Returns a subvector with the contents of a region of the vector.

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

get()

template
value_typeaie::detail::vector< T, Elems >::get ( unsigned idx ) const
inline

Returns the value of the element on the given index.

Parameters
idx Index of the element.

grow()

template
template
constexprvectoraie::detail::vector< T, Elems >::grow ( unsigned idx=0 ) const
inlineconstexpr

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

Template Parameters
ElemsOut Size of the output vector.
Parameters
idx Location of the subvector within the output vector

grow_replicate()

template
template
constexprvectoraie::detail::vector< T, Elems >::grow_replicate ( ) const
inlineconstexpr

Returns a copy of the current vector in a larger vector. The contents of the vector are replicated as many times as required to fill the output vector

Template Parameters
ElemsOut Size of the output vector.

insert()[1/2]

template
template
vector&aie::detail::vector< T, Elems >::insert ( unsigned idx,
constvector< T, ElemsIn > & v
)
inline

Updates the contents of a region of the vector using the values in the given subvector and returns a reference to the updated vector.

Parameters
idx Index of the subvector to be replaced.
v Subvector to be written into the region.

insert()[2/2]

template
template
vector&aie::detail::vector< T, Elems >::insert ( unsigned idx,
typenamevector< T, ElemsIn >::native_type v
)
inline

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

Parameters
idx Index of the subvector to be replaced.
v Native subvector to be written into the region.

is_complex()

template
static constexpr boolaie::detail::vector< T, Elems >::is_complex ( )
inlinestaticconstexpr

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

is_floating_point()

template
static constexpr boolaie::detail::vector< T, Elems >::is_floating_point ( )
inlinestaticconstexpr

Returns a bool that says whether the element type is floating-point.

is_integral()

template
static constexpr boolaie::detail::vector< T, Elems >::is_integral ( )
inlinestaticconstexpr

Returns a bool that says whether the element type is an integer.

is_real()

template
static constexpr boolaie::detail::vector< T, Elems >::is_real ( )
inlinestaticconstexpr

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

is_signed()

template
static constexpr boolaie::detail::vector< T, Elems >::is_signed ( )
inlinestaticconstexpr

Returns a bool that says whether the element type is signed.

load()

template
template< aie_dm_resourceResource, typename T2 >
voidaie::detail::vector< T, Elems >::load ( const T2 * ptr )
inline

Replaces the contents of the vector with the values pointed by the given memory address. Address is assumed to meet the alignment requirements for vector loads (>= 32 bytes).

Parameters
ptr Pointer to the location of the values in memory.

load_unaligned()

template
template< aie_dm_resourceResource, typename T2 >
voidaie::detail::vector< T, Elems >::load_unaligned ( const T2 * ptr,
unsigned aligned_elems
)
inline

Replaces the contents of the vector with the values pointed by the given memory address. Address is assumed to be aligned to the given amount of elements.

Parameters
ptr Pointer to the location of the values in memory.
aligned_elems Number of elements ptr is aligned to.

operator native_type()

template
aie::detail::vector< T, Elems >::operatornative_type ( ) const
inline

Operator for conversion to the native type

operator[]()[1/2]

template
constexprvector_elem_ref<value_type, Elems>aie::detail::vector< T, Elems >::operator[] ( unsigned idx )
inlineconstexpr

Returns a reference object to the element on the given index.

Parameters
idx Index of the element.

operator[]()[2/2]

template
constexprvector_elem_const_ref<value_type, Elems>aie::detail::vector< T, Elems >::operator[] ( unsigned idx ) const
inlineconstexpr

Returns a constant reference object to the element on the given index.

Parameters
idx Index of the element.

pack()

template
template
vectoraie::detail::vector< T, Elems >::pack ( ) const
inline

Converts the current vector of 16b elements into a vector of 8b elements.

push()

template
vector&aie::detail::vector< T, Elems >::push ( value_type v )
inline

Shifts all elements in the vector up and writes the given value into the first position of the vector (the element in the last position of the vector is lost).

Parameters
v Value to be written into the first position of the vector

set()

template
voidaie::detail::vector< T, Elems >::set ( value_type v,
unsigned idx
)
inline

Updates the value of the element on the given index.

Parameters
v Value to write.
idx Index of the element whose value is updated.

size()

template
static constexpr unsignedaie::detail::vector< T, Elems >::size ( )
inlinestaticconstexpr

Returns the number of elements in the vector.

split()

template
template
autoaie::detail::vector< T, Elems >::split ( ) const
inline

Returns the contents of the current vector stored in a std::tuple of subvectors.

Template Parameters
ElemsOut Size of each subvector.

store()

template
template< aie_dm_resourceResource, typename T2 >
voidaie::detail::vector< T, Elems >::store ( T2 * ptr ) const
inline

Writes the contents of the vector into the given memory address. Address is assumed to meet the alignment requirements for vector stores (>= 32 bytes).

Parameters
ptr Pointer to the location where the vector contents must be written in memory.

store_unaligned()

template
template< aie_dm_resourceResource, typename T2 >
voidaie::detail::vector< T, Elems >::store_unaligned ( T2 * ptr,
unsigned aligned_elems
) const
inline

Writes the contents of the vector into the given memory address. Address is assumed to be aligned to the given amount of elements.

Parameters
ptr Pointer to the location where the vector contents must be written in memory.
aligned_elems Number of elements ptr is aligned to.

unpack()

template
vector<int16, Elems>aie::detail::vector< T, Elems >::unpack ( ) const
inline

Converts the current vector of 8b elements into a vector of 16b elements.

upd_all()

template
template
vector&aie::detail::vector< T, Elems >::upd_all ( SubVectors &&... subvectors )
inline

Updates the contents of the vector using the values in the given subvectors. Subvectors must be of the same type and size.

Parameters
subvectors List of subvectors.

Friends And Related Function Documentation

vector

template
template
friend classvector
friend

Type for vector registers. The documentation of this class and its members can be found atdetail::vector.

Template Parameters
T Type of the elements contained in the vector. It must meetElemBaseType.
Elems Number of elements in the vector.

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