AI Engine API User Guide (AIE) 2022.1
Memory

Overview

Each AIE core has access to up to 4 Data Memories (DM). Global variables, graph communication buffers (such as windows), and the stack are placed by the linker on these memories.

The AIE API provides a number of functions and types that allow applications to efficiently read and write vector data stored on DM.

Vector alignment

Applications can load from DM into vector registers and store the contents of vector registers into DM. Memory instructions in the AIE that operate on vectors have alignment requirements. Therefore, functions are provided for both aligned and unaligned accesses. Aligned accesses are done using the aie::load_v and aie::store_v functions, while unaligned accesses are performed using aie::load_unaligned_v and aie::store_unaligned_v functions. Unaligned accesses may incur additional overhead depending on the amount of misalignment.

Users can ensure that buffers are aligned using standard C/C++ facilities such as alignas. The API provides a global constant value (aie::vector_decl_align) that can be used to align the buffer to a boundary that works for any vector size.

alignas(aie::vector_decl_align) static int16 my_buffer[BUFFER_COUNT];
int16_t int16
Definition: types.hpp:63

Memory bank conflicts

AIE cores are able to perform several vector load/store operations per instruction. However, in order for them to be executed in parallel, they must target different memory banks. aiecompiler will try to evenly distribute buffers from communication primitives, and users can manually place buffers on specific banks by specifying the address range in the linker script file.

In general the compiler will try to schedule many accesses in the same instruction when possible. However, in scenarios in which this would translate into bank conflicts, this behavior might not be desirable. The compiler provides type annotations to associate memory accesses to virtual resources. Accesses using types that are associated to the same virtual resource will not be scheduled in the same instruction.

void fn(int __aie_dm_resource_a * A,
int * B,
{
aie::vector<int, 8> v1 = aie::load_v<8>(A); // Access from A and C are bound to the same virtual resource so they
aie::vector<int, 8> v2 = aie::load_v<8>(B); // are never scheduled on the same instruction. B is not annotated so
aie::vector<int, 8> v3 = aie::load_v<8>(C); // its memory accesses can be scheduled in the same instruction with
// accesses to A or C.
...
}
Definition: aie_declaration.hpp:68
#define __aie_dm_resource_a
Definition: types.hpp:81

Also, most memory access functions in the AIE API accept an enum value from aie_dm_resource that can be used to bind individual accesses to a virtual resource.

void fn(int __aie_dm_resource_a * A,
int * B
{
aie::vector<int, 8> v1 = aie::load_v<8>(A);
aie::vector<int, 8> v2 = aie::load_v<8>(B); // This access can be scheduled on the same instruction as the access
// to A since B is not annotated.
aie::vector<int, 8> v3 = aie::load_v<8, aie_dm_resource::a>(B); // This specific access to B is annotated with
// the same virtual resource as A, so they cannot
// be scheduled on the same instruction.
...
}

Typedefs

template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::circular_iterator = detail::circular_iterator< T, Elems, 1, Resource >
  More...
 
template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_circular_iterator = detail::const_circular_iterator< T, Elems, 1, Resource >
  More...
 
template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_random_circular_iterator = detail::const_random_circular_iterator< T, Elems, 1, Resource >
  More...
 
template<typename T , unsigned N, size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_vector_circular_iterator = detail::const_vector_circular_iterator< T, N, Elems, 1, Resource >
  More...
 
template<typename T , unsigned Elems, size_t ArrayElems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_vector_random_circular_iterator = detail::const_vector_random_circular_iterator< T, Elems, ArrayElems, 1, Resource >
  More...
 
template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::random_circular_iterator = detail::random_circular_iterator< T, Elems, 1, Resource >
  More...
 
template<typename T , unsigned N, size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::vector_circular_iterator = detail::vector_circular_iterator< T, N, Elems, 1, Resource >
  More...
 
template<typename T , unsigned Elems, size_t ArrayElems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::vector_random_circular_iterator = detail::vector_random_circular_iterator< T, Elems, ArrayElems, 1, Resource >
  More...
 

Functions

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin (T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, unsigned Elems = 0>
constexpr auto aie::begin (T(&base)[Elems])
  More...
 
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_circular (T *base)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_circular (T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr auto aie::begin_circular (T(&base)[Elems])
  More...
 
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_random_circular (T *base)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_random_circular (T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr auto aie::begin_random_circular (T(&base)[Elems])
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_restrict_vector (const T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_restrict_vector (T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_unaligned_vector (T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_vector (const T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_vector (T *base)
  More...
 
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_circular (T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_circular (T *base, size_t n)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::begin_vector_circular (T(&base)[ArrayElems])
  More...
 
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_random_circular (T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_random_circular (T *base, size_t n)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::begin_vector_random_circular (T(&base)[ArrayElems])
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin (const T *base, size_t n)
  More...
 
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr const_circular_iterator< T, Elems, Resource > aie::cbegin_circular (const T *base)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr const_circular_iterator< T, dynamic_extent, Resource > aie::cbegin_circular (const T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr const_circular_iterator< T, Elems, Resource > aie::cbegin_circular (const T(&base)[Elems])
  More...
 
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_random_circular (const T *base)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_random_circular (const T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr auto aie::cbegin_random_circular (const T(&base)[Elems])
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::cbegin_restrict_vector (const T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::cbegin_unaligned_vector (T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::cbegin_vector (const T *base)
  More...
 
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_circular (const T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_circular (const T *base, size_t n)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::cbegin_vector_circular (const T(&base)[ArrayElems])
  More...
 
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_random_circular (const T *base)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_random_circular (const T *base, size_t n)
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::cbegin_vector_random_circular (const T(&base)[ArrayElems])
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cend (const T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::end (T *base, size_t n)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, unsigned Elems = 0>
constexpr auto aie::end (T(&base)[Elems])
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_floor_bytes_v (const T *ptr, size_t bytes) -> vector< aie_dm_resource_remove_t< T >, Elems >
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_floor_v (const T *ptr, unsigned n=Elems) -> vector< aie_dm_resource_remove_t< T >, Elems >
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_unaligned_v (const T *ptr, unsigned aligned_elems=1) -> vector< aie_dm_resource_remove_t< T >, Elems >
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_unaligned_v (const T *ptr, unsigned aligned_elems=1) -> vector< aie_dm_resource_remove_t< T >, native_vector_length_v< T >>
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_v (const T *ptr) -> vector< aie_dm_resource_remove_t< T >, Elems >
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_v (const T *ptr) -> vector< aie_dm_resource_remove_t< T >, native_vector_length_v< T >>
  More...
 
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1 = void, ElemBaseType T2 = void>
T1 * aie::store_unaligned_v (T1 *ptr, const vector< T2, Elems > &v, unsigned aligned_elems=1)
  More...
 
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1 = void, ElemBaseType T2, unsigned Elems = 0>
T1 * aie::store_v (T1 *ptr, const vector< T2, Elems > &v)
  More...
 

Typedef Documentation

◆ circular_iterator

template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::circular_iterator = typedef detail::circular_iterator<T, Elems, 1, Resource>

Implements an iterator that wraps around when it reaches the end of the buffer and, thus, has no end.

The interface meets forward iterator.

Template Parameters
TType of the elements in the array.
ElemsSize of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.

◆ const_circular_iterator

template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_circular_iterator = typedef detail::const_circular_iterator<T, Elems, 1, Resource>

Same as circular_iterator, but the contents of the iterated array cannot be modified.

◆ const_random_circular_iterator

template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_random_circular_iterator = typedef detail::const_random_circular_iterator<T, Elems, 1, Resource>

Same as random_circular_iterator, but the contents of the iterated array cannot be modified.

◆ const_vector_circular_iterator

template<typename T , unsigned N, size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_vector_circular_iterator = typedef detail::const_vector_circular_iterator<T, N, Elems, 1, Resource>

Same as vector_circular_iterator, but the contents of the iterated array cannot be modified.

◆ const_vector_random_circular_iterator

template<typename T , unsigned Elems, size_t ArrayElems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::const_vector_random_circular_iterator = typedef detail::const_vector_random_circular_iterator<T, Elems, ArrayElems, 1, Resource>

Same as vector_random_circular_iterator, but the contents of the iterated array cannot be modified.

◆ random_circular_iterator

template<typename T , size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::random_circular_iterator = typedef detail::random_circular_iterator<T, Elems, 1, Resource>

Implements an iterator that wraps around when it reaches the end or the beginning of the buffer and, thus, has no end.

The interface meets random access iterator.

Template Parameters
TType of the elements in the array.
ElemsSize of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.
ResourceData Memory resource to be used for the access when dereferencing the iterator.

◆ vector_circular_iterator

template<typename T , unsigned N, size_t Elems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::vector_circular_iterator = typedef detail::vector_circular_iterator<T, N, Elems, 1, Resource>

Implements a vector iterator that wraps around when it reaches the end of the buffer and, thus, has no end.

The interface meets forward iterator.

Template Parameters
TType of the elements in the array.
NSize of the vector returned when dereferencing the iterator.
ElemsSize of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.

◆ vector_random_circular_iterator

template<typename T , unsigned Elems, size_t ArrayElems = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using aie::vector_random_circular_iterator = typedef detail::vector_random_circular_iterator<T, Elems, ArrayElems, 1, Resource>

Implements a vector iterator that wraps around when it reaches the end or the beginning of the buffer and, thus, has no end.

The interface meets random access iterator.

Template Parameters
TType of the elements in the array.
ElemsSize of the vector returned when dereferencing the iterator.
ArrayElemsSize of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.
ResourceData Memory resource to be used for the access when dereferencing the iterator.

Function Documentation

◆ begin() [1/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin ( T *  base,
size_t  n 
)
constexpr

Returns an iterator for the array described by the given address and size.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ begin() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, unsigned Elems = 0>
constexpr auto aie::begin ( T(&)  base[Elems])
constexpr

Returns an iterator for the given statically-sized array.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ begin_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_circular ( T *  base)
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_circular ( T *  base,
size_t  n 
)
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ begin_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr auto aie::begin_circular ( T(&)  base[Elems])
constexpr

Returns a circular iterator for the given statically-sized array.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ begin_random_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_random_circular ( T *  base)
constexpr

Returns a random-access circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_random_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_random_circular ( T *  base,
size_t  n 
)
constexpr

Returns a random-access circular iterator for the array described by the given address and size.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ begin_random_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr auto aie::begin_random_circular ( T(&)  base[Elems])
constexpr

Returns a random-access circular iterator for the array described by the given address and size.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ begin_restrict_vector() [1/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_restrict_vector ( const T *  base)
constexpr

Same as begin_vector, but the given pointer is considered restrict.

The returned iterator is const.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_restrict_vector() [2/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_restrict_vector ( T *  base)
constexpr

Same as begin_vector, but the given pointer is considered restrict.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_unaligned_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_unaligned_vector ( T *  base)
constexpr

Returns a vector iterator starting at the given address. Elements in the vector will have the same type of the pointer parameter, and the size of the vector is specified via a template argument.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_vector() [1/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_vector ( const T *  base)
constexpr

Returns a vector iterator starting at the given address. Elements in the vector will have the same type of the pointer parameter, and the size of the vector is specified via a template argument. The pointer is assumed to meet the alignment requirements for a vector load of this size.

The returned iterator is const.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_vector() [2/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::begin_vector ( T *  base)
constexpr

Returns a vector iterator starting at the given address. Elements in the vector will have the same type of the pointer parameter, and the size of the vector is specified via a template argument. The pointer is assumed to meet the alignment requirements for a vector load of this size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_vector_circular() [1/3]

template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_circular ( T *  base)
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ArrayElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_vector_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_circular ( T *  base,
size_t  n 
)
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ begin_vector_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::begin_vector_circular ( T(&)  base[ArrayElems])
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ begin_vector_random_circular() [1/3]

template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_random_circular ( T *  base)
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ArrayElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ begin_vector_random_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::begin_vector_random_circular ( T *  base,
size_t  n 
)
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ begin_vector_random_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::begin_vector_random_circular ( T(&)  base[ArrayElems])
constexpr

Returns a circular iterator for the array described by the given address and size.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ cbegin()

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin ( const T *  base,
size_t  n 
)
constexpr

Returns an iterator for the constant array described by the given address and size.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ cbegin_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr const_circular_iterator<T, Elems, Resource> aie::cbegin_circular ( const T *  base)
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr const_circular_iterator<T, dynamic_extent, Resource> aie::cbegin_circular ( const T *  base,
size_t  n 
)
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ cbegin_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr const_circular_iterator<T, Elems, Resource> aie::cbegin_circular ( const T(&)  base[Elems])
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ cbegin_random_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_random_circular ( const T *  base)
constexpr

Similar to begin_random_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_random_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_random_circular ( const T *  base,
size_t  n 
)
constexpr

Similar to begin_random_circular, but the returned iterator is constant.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ cbegin_random_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t Elems = 0>
constexpr auto aie::cbegin_random_circular ( const T(&)  base[Elems])
constexpr

Similar to begin_random_circular, but the returned iterator is constant.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ cbegin_restrict_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::cbegin_restrict_vector ( const T *  base)
constexpr

Same as begin_vector, but the given pointer is considered restrict.

The returned iterator is const.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_unaligned_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::cbegin_unaligned_vector ( T *  base)
constexpr

Returns a vector iterator starting at the given address. Elements in the vector will have the same type of the pointer parameter, and the size of the vector is specified via a template argument.

The returned iterator is const.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
constexpr auto aie::cbegin_vector ( const T *  base)
constexpr

Same as begin_vector.

The returned iterator is const.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_vector_circular() [1/3]

template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_circular ( const T *  base)
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ArrayElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_vector_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_circular ( const T *  base,
size_t  n 
)
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ cbegin_vector_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::cbegin_vector_circular ( const T(&)  base[ArrayElems])
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ cbegin_vector_random_circular() [1/3]

template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_random_circular ( const T *  base)
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ArrayElemsNumber of elements in the array.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.

◆ cbegin_vector_random_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cbegin_vector_random_circular ( const T *  base,
size_t  n 
)
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ cbegin_vector_random_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T = void, size_t ArrayElems = 0>
constexpr auto aie::cbegin_vector_random_circular ( const T(&)  base[ArrayElems])
constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters
ElemsNumber of elements in the vectors returned by the iterator.
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ cend()

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::cend ( const T *  base,
size_t  n 
)
constexpr

Returns an iterator that points at the end of the constant array described by the given address and size.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ end() [1/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void>
constexpr auto aie::end ( T *  base,
size_t  n 
)
constexpr

Returns an iterator that points at the end of the array described by the given address and size

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStarting address for the iterator.
nNumber of elements in the array.

◆ end() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T = void, unsigned Elems = 0>
constexpr auto aie::end ( T(&)  base[Elems])
constexpr

Returns an iterator that points at the end of the given statically-sized array.

Template Parameters
ResourceData Memory resource to be used for the access when dereferencing the iterator.
Parameters
baseStatically-sized array.

◆ load_floor_bytes_v()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_floor_bytes_v ( const T *  ptr,
size_t  bytes 
) -> vector<aie_dm_resource_remove_t<T>, Elems>

Load a vector of Elems size whose elements have type T. The pointer will be aligned to bytes.

Template Parameters
ElemsSize of the vector to be read from memory
Parameters
ptrAddress data is read from
bytesNumbers of bytes to which the input pointer is aligned. Must be a power of two.

◆ load_floor_v()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_floor_v ( const T *  ptr,
unsigned  n = Elems 
) -> vector<aie_dm_resource_remove_t<T>, Elems>

Load a vector of Elems size whose elements have type T. The pointer will be aligned to n * sizeof(T).

Template Parameters
ElemsSize of the vector to be read from memory
Parameters
ptrAddress data is read from
nNumbers of elements of type T to which the input pointer is aligned. Must be a power of two.

◆ load_unaligned_v() [1/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_unaligned_v ( const T *  ptr,
unsigned  aligned_elems = 1 
) -> vector<aie_dm_resource_remove_t<T>, Elems>

Load a vector of Elems size whose elements have type T. The pointer is assumed to be aligned to T.

for (unsigned i = 0; i < Elems; ++i)
out[i] = ptr[i];
Template Parameters
ElemsSize of the vector to be read from memory
Parameters
ptrAddress data is read from
aligned_elemsNumber of elements the pointer is aligned to. If unspecified, the default value is 1.

◆ load_unaligned_v() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_unaligned_v ( const T *  ptr,
unsigned  aligned_elems = 1 
) -> vector<aie_dm_resource_remove_t<T>, native_vector_length_v<T>>

Load a vector whose elements have type T. The size is automatically chosen with the optimal size for the current architecture. The pointer is assumed to be aligned to T.

for (unsigned i = 0; i < Elems; ++i)
out[i] = ptr[i];
Parameters
ptrAddress data is read from
aligned_elemsNumber of elements the pointer is aligned to. If unspecified, the default value is 1.

◆ load_v() [1/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_v ( const T *  ptr) -> vector<aie_dm_resource_remove_t<T>, Elems>

Load a vector of Elems size whose elements have type T. The pointer is assumed to meet the alignment requirements for a vector load of this size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = ptr[i];
Template Parameters
ElemsSize of the vector to be read from memory
Parameters
ptrAddress data is read from

◆ load_v() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T = void>
auto aie::load_v ( const T *  ptr) -> vector<aie_dm_resource_remove_t<T>, native_vector_length_v<T>>

Load a vector whose elements have type T. The size is automatically chosen with the optimal size for the current architecture. The pointer is assumed to meet the alignment requirements for a vector load of this size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = ptr[i];
Parameters
ptrAddress data is read from

◆ store_unaligned_v()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1 = void, ElemBaseType T2 = void>
T1* aie::store_unaligned_v ( T1 *  ptr,
const vector< T2, Elems > &  v,
unsigned  aligned_elems = 1 
)

Store a vector of Elems size whose elements have type T. The pointer is assumed to be aligned to T.

for (unsigned i = 0; i < Elems; ++i)
ptr[i] = v[i];
Parameters
ptrAddress data is written to
vVector to be written to memory
aligned_elemsNumber of elements the pointer is aligned to. If unspecified, the default value is 1.

◆ store_v()

template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1 = void, ElemBaseType T2, unsigned Elems = 0>
T1* aie::store_v ( T1 *  ptr,
const vector< T2, Elems > &  v 
)

Store a vector of Elems size whose elements have type T. The pointer is assumed to meet the alignment requirements for a vector store of this size.

for (unsigned i = 0; i < Elems; ++i)
ptr[i] = v[i];
Parameters
ptrAddress data is written to
vVector to be written to memory