| AI Engine API User Guide (AIE-API) 2026.1

Loading...
Searching...
No Matches
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.

# Data Loading And 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 as summarised in vector alignment requirements table.

Required pointer alignment for a given memory access size
Arch. | 128b access | 256b access | 512b access
--- | --- | --- | ---
AIE | 128b |  |
AIE-ML XDNA1 | 128b | 256b |
XDNA2 | 128b | 256b | 512b
AIE-MLv2 | 128b | 256b | 512b

Therefore, functions are provided for both aligned and unaligned accesses. Aligned accesses are done using the aie::load_v and aie::store_v functions. Performing memory accesses to unaligned pointers using these functions is undefined behaviour. The following code block shows example usages of the aligned access functions:

template <typename T>
T* aligned_memcpy(T* __restrict dest, const T* src, unsigned n)
{
// 256b vectors are used in this example
static constexpr unsigned Bits = 256;
static constexpr unsigned Lanes = Bits / aie::detail::type_bits_v<T>;
T* p = dest;
// Assume n is divisible by Lanes
for (unsigned i = 0; i < n / Lanes; ++i)
{
aie::vector<T, Lanes> v = aie::load_v<Lanes>(src);
aie::store_v(p, v);
src += Lanes;
p += Lanes;
}
return dest;
}

while unaligned accesses are performed using aie::load_unaligned_v and aie::store_unaligned_v functions. These unaligned access functions are demostrated below.

template <typename T>
T* unaligned_memcpy(T* __restrict dest, const T* src, unsigned n, unsigned dest_align = 1, unsigned src_align = 1)
{
// dest_align, src_align indicate to how many elements their respective pointers are aligned
// 256b vectors are used in this example
static constexpr unsigned Bits = 256;
static constexpr unsigned Lanes = Bits / aie::detail::type_bits_v<T>;
T* p = dest;
// Assume n is divisible by Lanes
for (unsigned i = 0; i < n / Lanes; ++i)
{
aie::vector<T, Lanes> v = aie::load_unaligned_v<Lanes>(src, src_align);
aie::store_unaligned_v(p, v, dest_align);
src += Lanes;
p += Lanes;
}
return dest;
}

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];

Additional helper functions, aie::load_floor_v, are available that will perform a load at the requested alignment from the given address:

alignas(aie::vector_decl_align) static int16 data[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
int16 *ptr = &data[3];
aie::vector<int16, 16> v = aie::load_floor_v<16>(ptr, 16);
aie::print(v, true); // Prints 0 1 2 ... 13 14 15

# 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,
int __aie_dm_resource_a * C)
{
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.
...
}
aie::vector
Type for vector registers.
Definition vector.hpp:75
aie::load_v
auto load_v(const T *ptr) -> vector< aie_dm_resource_remove_t< T >, Elems >
Load a vector of Elems size whose elements have type T.
Definition aie.hpp:574

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.
...
}

# Iterators

The AIE API provides two kinds of iterators that map semantically to the C++ standard library's LegacyForwardIterator and LegacyRandomAccessIterator. The functionality exposed by these iterators are shown in the table below:

Iterator Kinds
Type | Operation | Code Example
--- | --- | ---
Forward Iterator | Dereference | *it
Equality/Inequality | it1 == it2 / it1 != it2
Pre/post-increment | ++it / it++
Random Access Iterator | Pre/post-decrement | --it / it--
Arbitrary increment/decrement | it += offset / it -= offset
Random Access | it[offset]

Note that the forward iterator is a subset of the random access iterator meaning that all operations implemeneted for forward iterators are also implemented for random access iterators. With these iterators defined, the types of iterators offered by the AIE API are outlined below with the iterator kind expressing the operators defined for each iterator:

AIE API Iterator Types
| Type | Constructor | Iterator Kind
--- | --- | --- | ---
Scalar | Basic | aie::begin | Forward Iterator
Circular | aie::begin_circular | Forward Iterator
Random Circular | aie::begin_random_circular | Random Access Iterator
Pattern | aie::begin_pattern | Forward Iterator
Vector | Basic | aie::begin_vector | Random Access Iterator
Circular | aie::begin_vector_circular | Forward Iterator
Random Circular | aie::begin_vector_random_circular | Random Access Iterator
Restrict | aie::begin_restrict_vector | Random Access Iterator
Unaligned | aie::begin_unaligned_vector | Forward Iterator

All iterators also have const alternatives, which follow the naming convention laid out by the C++ standard library i.e. the const version of an iterator created with aie::begin_vector_circular can be created with aie::cbegin_vector_circular.

# Buffer Streams

In cases where iterators are inappropriate due to either semantic or performance issues, buffer streams are provided. Buffer streams do not conform to an iterator interface but rather a stream interface, similar to iostreams, which implies that a read or write operation will advance the stream, altering its state.

Note
  If the type name contains input or output the stream will only support reading or writing respectively.

AIE API Stream Operations
Operation | Stream operator | Member function
--- | --- | ---
Read | operator>>(value_type&) | value_type pop()
Write | operator<<(value_type&) | value_type push()

## Tensor Buffer Streams

Tensor buffer streams are an abtraction provided by the AIE API to handle multi-dimensional addressing.

Note
  Multi-dimensional addressing was introduced on AIE-ML/XDNA1.

### Tensor Descriptor

An aie::tensor_descriptor object serves as a mapping from a multidimensional tensor to a 1-D memory space. A tensor descriptor is constructed from an element type, the number of elements that make up a vector block within the tensor, and a list of aie::tensor_dim objects, which are pairs of size-step pairs that describe each dimension of the tensor.

The following illustration shows how a 3-D volume can be described. Here the element type is int8, and the number of elements per block is 32, resulting in segments of the tensor being aie::vector<int8, 32>. The size of each dimension is given in the first paremeter of each aie::tensor_dim, while the size of the increment required to take a step in each dimension given as the second parameter. Note that this example assumes that the data is laid out in row-major order. This tensor representation allows a subvolume of the tensor to be iterated over a number of times by adding an additional aie::tensor_dim with step set to zero snd the size set to the desired number of iterations. See Tensor Buffer Stream Composition for an example.

Such a tensor descriptor may be used to construct a tensor buffer stream as shown below. The returned stream serializes the accesses to the buffer as it is read, which is also illustraded below.

alignas(aie::vector_decl_align) static int16 buff[256];
std::iota(buff, buff + 256, 0);
auto desc = aie::make_tensor_descriptor<int16, 32>(
aie::tensor_dim(2u, 4),
aie::tensor_dim(2u, 2),
aie::tensor_dim(2u, 1));
auto tbs = aie::make_tensor_buffer_stream(ptr, desc);
for (unsigned i = 0; i < 8; ++i) {
aie::vector<int16, 32> v;
tbs >> v;
// Alternatively:
// auto v = tbs.pop(); // will deduce the vector type from the tensor descriptor
printf("%d: {%d, ..., %d\n}", i, v.get(0), v.get(31));
}
// Prints:
// 0: {0, ..., 31}
// 1: {32, ..., 63}
// 2: {64, ..., 95}
// 3: {96, ..., 127}
// 4: {128, ..., 159}
// 5: {160, ..., 191}
// 6: {192, ..., 223}
// 7: {224, ..., 255}
aie::make_tensor_buffer_stream
constexpr auto make_tensor_buffer_stream(T &port, const TensorDescriptor &tensor_desc)
Creates a tensor buffer stream for accessing multidimensional data from an ADF I/O buffer port.
Definition io_buffer.hpp:779
aie::vector::get
value_type get(unsigned idx) const
Returns the value of the element on the given index.
Definition vector.hpp:279
aie::make_tensor_descriptor
constexpr auto make_tensor_descriptor(Args &&... args)
Creates a tensor descriptor that is to be used to create a tensor buffer stream.
Definition iterator.hpp:1927
aie::vector_decl_align
static constexpr unsigned vector_decl_align
Specifies the minimum alignment requirement for vector loads and stores.
Definition aie.hpp:531
aie::tensor_dim
Definition iterator.hpp:1748
int16
int16_t int16
Definition types.hpp:21

### Tensor Buffer Stream Composition

Tensor descriptors and associated buffer streams are composible to arbitrary dimensions; however, the underlying mechanisms on which the abstractions are built upon in AIE-ML/XDNA1 are three-dimensional. To overcome this, the tensor buffer streams are defined recursively, decomposing an N-dimensional tensor into (N-1)/3 nested streams, with a final N%3 leaf stream. To access an inner stream, the containing outer stream must be read with a .pop() call, which will advance the outer stream and return the inner stream. This recursive definition is illustrated below with a corresponding code snippet:

auto desc = aie::make_tensor_descriptor<int16, 32>(
aie::tensor_dim(2u, 4),
aie::tensor_dim(2u, 0),
aie::tensor_dim(6u, 8),
aie::tensor_dim(4u, 1));
auto tbs = aie::make_tensor_buffer_stream(ptr, desc);
for (unsigned i = 0; i < 2*2*6; ++i) {
auto tsb_inner = tbs.pop(); // Advance outer stream and return inner stream
aie::vector<int16, 32> a, b, c, d;
tbs_inner >> a >> b >> c >> d;
}
aie_dm_resource::a
@ a
Memory access is bound to resource a.
Definition aie_doc.hpp:1380
aie_dm_resource::c
@ c
Memory access is bound to resource c.
Definition aie_doc.hpp:1382
aie_dm_resource::d
@ d
Memory access is bound to resource d.
Definition aie_doc.hpp:1383
aie_dm_resource::b
@ b
Memory access is bound to resource b.
Definition aie_doc.hpp:1381

For a practical example, see GEMM leveraging multidimensional addressing.

### Tensor Descriptor from Native Types

In the case that the automatic decomposition described in Tensor Buffer Stream Composition is not desired, it is possible to manually decompose the tensor using native integer, aie::dim_2d, and aie::dim_3d descriptions of the increments to be carried out. The arguments to aie::dim_2d and aie::dim_3d differ from the aie::tensor_dim description as the num values represent the number of increments to carry out rather than the dimension size, and the increment at each dimension assumes that all previous increments have already been carried out.

aie::make_tensor_descriptor<int16, 32>(
aie::tensor_dim(2u, 4),
aie::tensor_dim(2u, 2),
aie::tensor_dim(2u, 1));
// Is equivalent to:
aie::make_tensor_descriptor_from_native<int16, 32>(
aie::dim_3d(1u, 1, // num1, inc1
1u, 1, // num2, inc2
1)); // inc3
aie::make_tensor_descriptor_from_native
constexpr auto make_tensor_descriptor_from_native(Args &&... args)
Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create ...
Definition iterator.hpp:2132
aie::dim_3d
detail::dim_3d dim_3d
Definition iterator.hpp:1738

As with the aie::tensor_dim description, dimensions can be composed arbitrarily using int, aie::dim_2d, and aie::dim_3d increments:

// 6-D tensor decription
aie::make_tensor_descriptor_from_native<int16, 32>(
aie::dim_3d(1u, 1, // num1, inc1
1u, 1, // num2, inc2
1), // inc3
8,
aie::dim_2d(3u, 4, // num1, inc1
4)); // inc2
aie::dim_2d
detail::dim_2d dim_2d
Definition iterator.hpp:1737

The exact increment values may also be set using aie::make_tensor_descriptor_from_native_bytes.

## Sparse Vector Input Buffer Streams

A buffer with appropriately prepared sparse data can be read using aie::sparse_vector_input_buffer_stream.

auto vbs = aie::sparse_vector_input_buffer_stream<int8, 128>(ptr);
aie::sparse_vector<int8, 128> a, b, c;
vbs >> a; // 1. Single read.
vbs >> b >> c; // 2. Multiple reads.
auto d = vbs.pop(); // 3. Identical to 1. but type of d is deduced to be aie::sparse_vector<int8, 128> from
// the buffer stream declaration.
// This is useful as `d` does not need to be declared ahead of time.
aie::sparse_vector
Type for sparse vector registers.
Definition sparse_vector.hpp:85
aie::sparse_vector_input_buffer_stream
Implements an input stream that reads sparse vectors from a memory buffer.
Definition iterator.hpp:1510

## Sparse Data Format

The supported sparse data layout requires a minimum of 50% sparsity. Specifically, two zero values within each group of four consecutive values. This 50% is a lower bound on the sparsity, meaning that further compression is possible if more zeroes are present. Loading sparse data from memory will interpret the first 64 bits as a mask. If a mask bit is not set, then 8 bits will be initialised to zero at its corresponding position. If the bit is set, then the 8 bits will be loading from the incompressible data that follows the mask. Hence, masks describe the layout of 512 bit after decompression.

Each mask must be aligned to a 32b boundary. Failure to meet this requirement will result in the sparse data being parsed incorrectly.

When loading sparse data, a partial decompression is carried out to reconstruct the data such that a 64b mask is paired with 256b partially decompressed data. This partial decompression is carried out as described in the following table. Note that 4 bits of the mask are used to represent two elements of the partially decompressed data.

Sparse partial decompression
Mask bits | Partially decompressed data
--- | ---
0 | 0 | 0 | 0 | 0 | 0
0 | 0 | 0 | 1 | 0 | A
0 | 0 | 1 | 0 | 0 | B
0 | 0 | 1 | 1 | B | A
0 | 1 | 0 | 0 | C | 0
0 | 1 | 0 | 1 | C | A
0 | 1 | 1 | 0 | C | B
1 | 0 | 0 | 0 | D | 0
1 | 0 | 0 | 1 | D | A
1 | 0 | 1 | 0 | D | B
1 | 1 | 0 | 0 | D | C

The following example demonstrates how a 128 element sparse vector is read from memory. It requires two sets of sparse data, each comprised of a 64b mask and the associated data.

constexpr unsigned N = 512;
alignas(aie::vector_decl_align) static int8 data[N];
void func() {
// Example setup of sparse buffer
// mask:
data[1] = 0b0000'0000; data[0] = 0b0000'0011;
data[3] = 0b0000'0000; data[2] = 0b0001'0000;
data[5] = 0b0000'0000; data[4] = 0b0000'0000;
data[7] = 0b0000'0000; data[6] = 0b0000'0000;
// data:
data[8] = 1; data[9] = 2; data[10] = 3; data[11] = 0;
// Note: data[11] is still considered as data for the previous group to ensure
// correct alignment of the next group's mask
// mask:
data[13] = 0b0000'0001; data[12] = 0b0001'0001;
data[15] = 0b0000'0000; data[14] = 0b0000'0000;
data[17] = 0b0000'0000; data[16] = 0b0000'0000;
data[19] = 0b1000'0000; data[18] = 0b0000'0000;
// data:
data[20] = 4; data[21] = 5; data[22] = 6; data[23] = 7;
auto vbs = aie::sparse_vector_input_buffer_stream<int8, 128>(data);
aie::sparse_vector<int8, 128> b = vbs.pop();
}
int8
int8_t int8
Definition types.hpp:20

For a more comprehensive sparse matrix multiplication example, see Supported Sparse Matrix Multiplication Modes.

## Block Vector Buffer Streams

Block vector types are unable to be loaded directly using the standard load APIs due to their sizes exceeding the core memory interface. An additional complication that arises due to the size mismatch is that while the first load may be well aligned, this would result in the second sequential load being misaligned. For example, if the core memory interface is 512b and a block vector size is 576b then each load would consist of two 512b loads and some additional processing to combine the data from each load correctly the ensure only the intended data is combined into the final loaded values. See below.

To overcome these challenges, the AIE leverages a separate FIFO memory interface, which will share the same memory interface size but will enable larger, unaligned pops into the core. The implementation details of this interface is abstracted by the AIE API as the following types:

- aie::block_vector_input_buffer_stream
- aie::block_vector_restrict_input_buffer_stream
- aie::block_vector_output_buffer_stream
- aie::block_vector_restrict_output_buffer_stream

An example usage is shown below:

T *ptr; // T is a block type, such as mx9
aie::vector<bfloat16, 64> data(...);
aie::accum<accfloat, 64> acc(data); // Conversions exists from accum to block vectors
aie::block_vector_output_buffer_stream<T, 64> out_stream(ptr);
out_stream << acc.to_vector<T>(); // Write block vector to memory
aie::block_vector<T, 64> v;
aie::block_vector_input_buffer_stream<T, 64> in_stream(ptr);
in_stream >> v; // Read block vector from memory
aie::accum
Type for vector accumulators.
Definition accum.hpp:49

This example demonstrates the usefulness of the block vector streams as all maintainance of the FIFO is handled internally by the stream object.

## Classes
class | aie::circular_iterator< T, Size, Resource >
| Implements an iterator that wraps around when it reaches the end of the buffer and, thus, has no end. More...
class | aie::random_circular_iterator< T, Size, Resource >
| Implements an iterator that wraps around when it reaches the end or the beginning of the buffer and, thus, has no end. More...
class | aie::sparse_vector_input_buffer_stream< T, Elems, Resource >
| Implements an input stream that reads sparse vectors from a memory buffer. More...
class | aie::unaligned_vector_input_buffer_stream< T, Elems, Resource >
| Implements an input stream that reads from a memory buffer with vector granularity. More...
class | aie::unaligned_vector_iterator< T, Elems, Resource >
| Implements an iterator that traverses an array using vectors instead of scalar values. More...
class | aie::unaligned_vector_output_buffer_stream< T, Elems, Resource >
| Implements an output stream that writes into a memory buffer with vector granularity. More...
class | aie::vector_circular_iterator< T, Elems, Size, Resource >
| Implements a vector iterator that wraps around when it reaches the end of the buffer and, thus, has no end. More...
class | aie::vector_input_buffer_stream< T, Elems, Resource >
| Implements an input stream that reads from a memory buffer with vector granularity. More...
class | aie::vector_iterator< T, Elems, Resource >
| Implements an iterator that traverses an array using vectors instead of scalar values. More...
class | aie::vector_output_buffer_stream< T, Elems, Resource >
| Implements an output stream that writes into a memory buffer with vector granularity. More...
class | aie::vector_random_circular_iterator< T, Elems, Size, Resource >
| Implements a vector iterator that wraps around when it reaches the end or the beginning of the buffer and, thus, has no end. More...

## Typedefs
template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using | aie::const_circular_iterator = circular_iterator<const T, Size, Resource>
| Same as circular_iterator, but the contents of the iterated array cannot be modified.
template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>
using | aie::const_random_circular_iterator = random_circular_iterator<const T, Size, Resource>
| Same as random_circular_iterator, but the contents of the iterated array cannot be modified.
template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
using | aie::const_unaligned_vector_iterator = unaligned_vector_iterator<const std::remove_const_t<T>, Elems, Resource>
| Same as unaligned_vector_iterator, but the contents of the iterated array cannot be modified.
template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
using | aie::const_vector_circular_iterator = vector_circular_iterator<const T, Elems, Size, Resource>
| Same as circular_iterator, but the contents of the iterated array cannot be modified.
template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
using | aie::const_vector_iterator = vector_iterator<const std::remove_const_t<T>, Elems, Resource>
| Same as vector_iterator, but the contents of the iterated array cannot be modified.
template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>
using | aie::const_vector_random_circular_iterator = vector_random_circular_iterator<const T, Elems, Size, Resource>
| Same as vector_random_circular_iterator, but the contents of the iterated array cannot be modified.

## Functions
template<aie_dm_resource Resource, typename T>
constexpr auto | aie::begin (T *base, size_t n)
| Returns an iterator for the array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T, unsigned Elems>
constexpr auto | aie::begin (T(&base)[Elems])
| Returns an iterator for the given statically-sized array.
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr circular_iterator< T, Elems, Resource > | aie::begin_circular (T *base)
| Returns a circular iterator for the array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr circular_iterator< T, dynamic_extent, Resource > | aie::begin_circular (T *base, size_t n)
| Returns a circular iterator for the array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>
constexpr circular_iterator< T, Elems, Resource > | aie::begin_circular (T(&base)[Elems])
| Returns a circular iterator for the given statically-sized array.
template<unsigned Steps, typename T, typename... Offsets>
constexpr auto | aie::begin_pattern (T *base, Offsets &&... offsets)
| Returns a forward iterator for the array described by the given address.
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr random_circular_iterator< T, Elems, Resource > | aie::begin_random_circular (T *base)
| Returns a random-access circular iterator for the array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr random_circular_iterator< T, dynamic_extent, Resource > | aie::begin_random_circular (T *base, size_t n)
| Returns a random-access circular iterator for the array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>
constexpr random_circular_iterator< T, Elems, Resource > | aie::begin_random_circular (T(&base)[Elems])
| Returns a random-access circular iterator for the array described by the given address and size.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr const_restrict_vector_iterator< T, Elems, Resource > | aie::begin_restrict_vector (const T *base)
| Same as begin_vector, but the given pointer is considered restrict.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr restrict_vector_iterator< T, Elems, Resource > | aie::begin_restrict_vector (T *base)
| Same as begin_vector, but the given pointer is considered restrict.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr unaligned_vector_iterator< T, Elems, Resource > | aie::begin_unaligned_vector (T *base)
| Returns a vector iterator starting at the given address.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr const_vector_iterator< T, Elems, Resource > | aie::begin_vector (const T *base)
| Returns a vector iterator starting at the given address.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr vector_iterator< T, Elems, Resource > | aie::begin_vector (T *base)
| Returns a vector iterator starting at the given address.
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr vector_circular_iterator< T, Elems, ArrayElems, Resource > | aie::begin_vector_circular (T *base)
| Returns a circular iterator for the array described by the given address and size.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr vector_circular_iterator< T, Elems, dynamic_extent, Resource > | aie::begin_vector_circular (T *base, size_t n)
| Returns a circular iterator for the array described by the given address and size.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>
constexpr vector_circular_iterator< T, Elems, ArrayElems, Resource > | aie::begin_vector_circular (T(&base)[ArrayElems])
| Returns a circular iterator for the array described by the given address and size.
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr vector_random_circular_iterator< T, Elems, ArrayElems, Resource > | aie::begin_vector_random_circular (T *base)
| Returns a circular iterator for the array described by the given address and size.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr vector_random_circular_iterator< T, Elems, dynamic_extent, Resource > | aie::begin_vector_random_circular (T *base, size_t n)
| Returns a circular iterator for the array described by the given address and size.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>
constexpr vector_random_circular_iterator< T, Elems, ArrayElems, Resource > | aie::begin_vector_random_circular (T(&base)[ArrayElems])
| Returns a circular iterator for the array described by the given address and size.
template<aie_dm_resource Resource, typename T>
constexpr auto | aie::cbegin (const T *base, size_t n)
| Returns an iterator for the constant array described by the given address and size.
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_circular_iterator< T, Elems, Resource > | aie::cbegin_circular (const T *base)
| Similar to begin_circular, but the returned iterator is constant.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_circular_iterator< T, dynamic_extent, Resource > | aie::cbegin_circular (const T *base, size_t n)
| Similar to begin_circular, but the returned iterator is constant.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>
constexpr const_circular_iterator< T, Elems, Resource > | aie::cbegin_circular (const T(&base)[Elems])
| Similar to begin_circular, but the returned iterator is constant.
template<unsigned Steps, typename T, typename... Offsets>
constexpr const_pattern_iterator< T, Steps > | aie::cbegin_pattern (const T *base, Offsets &&... offsets)
| Similar to begin_pattern, but the returned iterator is constant.
template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_random_circular_iterator< T, Elems, Resource > | aie::cbegin_random_circular (const T *base)
| Similar to begin_random_circular, but the returned iterator is constant.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_random_circular_iterator< T, dynamic_extent, Resource > | aie::cbegin_random_circular (const T *base, size_t n)
| Similar to begin_random_circular, but the returned iterator is constant.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>
constexpr const_random_circular_iterator< T, Elems > | aie::cbegin_random_circular (const T(&base)[Elems])
| Similar to begin_random_circular, but the returned iterator is constant.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr const_restrict_vector_iterator< T, Elems, Resource > | aie::cbegin_restrict_vector (const T *base)
| Same as begin_vector, but the given pointer is considered restrict.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr const_unaligned_vector_iterator< T, Elems, Resource > | aie::cbegin_unaligned_vector (T *base)
| Returns a vector iterator starting at the given address.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
constexpr const_vector_iterator< T, Elems, Resource > | aie::cbegin_vector (const T *base)
| Same as begin_vector.
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_vector_circular_iterator< T, Elems, ArrayElems, Resource > | aie::cbegin_vector_circular (const T *base)
| Similar to begin_circular, but the returned iterator is constant.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_vector_circular_iterator< T, Elems, dynamic_extent, Resource > | aie::cbegin_vector_circular (const T *base, size_t n)
| Similar to begin_circular, but the returned iterator is constant.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>
constexpr const_vector_circular_iterator< T, Elems, ArrayElems, Resource > | aie::cbegin_vector_circular (const T(&base)[ArrayElems])
| Similar to begin_circular, but the returned iterator is constant.
template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_vector_random_circular_iterator< T, Elems, ArrayElems, Resource > | aie::cbegin_vector_random_circular (const T *base)
| Similar to begin_circular, but the returned iterator is constant.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr const_vector_random_circular_iterator< T, Elems, dynamic_extent, Resource > | aie::cbegin_vector_random_circular (const T *base, size_t n)
| Similar to begin_circular, but the returned iterator is constant.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>
constexpr const_vector_random_circular_iterator< T, Elems, ArrayElems, Resource > | aie::cbegin_vector_random_circular (const T(&base)[ArrayElems])
| Similar to begin_circular, but the returned iterator is constant.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr auto | aie::cend (const T *base, size_t n)
| Returns an iterator that points at the end of the constant array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T>
constexpr auto | aie::end (T *base, size_t n)
| Returns an iterator that points at the end of the array described by the given address and size.
template<aie_dm_resource Resource = aie_dm_resource::none, typename T, unsigned Elems>
constexpr auto | aie::end (T(&base)[Elems])
| Returns an iterator that points at the end of the given statically-sized array.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
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.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
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.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
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.
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
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.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
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.
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>
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.
template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_restrict_tensor_buffer_stream (T *__restrict base, const TensorDescriptor &tensor_desc)
| Creates a restrict tensor buffer stream for accessing multidimensional data with optimized memory addressing patterns.
template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_buffer_stream (const T *base, const TensorDescriptor &tensor_desc)
| Creates a constant tensor buffer stream for accessing multidimensional data with optimized memory addressing patterns.
template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_buffer_stream (T *base, const TensorDescriptor &tensor_desc)
| Creates a tensor buffer stream for accessing multidimensional data with optimized memory addressing patterns.
template<Mask M, data_layout Layout = data_layout::row_major, TensorDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor (Args &&... args)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream of aie::mask values.
template<typename T, unsigned Elems, typename Repr, data_layout Layout = data_layout::row_major, TensorDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor (Args &&... args)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream.
template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, TensorDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor (Args &&... args)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream.
template<Mask M, data_layout Layout = data_layout::row_major> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor (const contiguous_dim &arg)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream of aie::mask values.
template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor (const contiguous_dim &arg)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream.
template<Mask M, data_layout Layout = data_layout::row_major, TensorDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_bytes (Args &&... args)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream of aie::mask values.
template<typename T, unsigned Elems, typename Repr, data_layout Layout = data_layout::row_major, TensorDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_bytes (Args &&... args)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream.
template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, TensorDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_bytes (Args &&... args)
| Creates a tensor descriptor that is to be used to create a tensor buffer stream.
template<Mask M, data_layout Layout = data_layout::row_major, NativeDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_from_native (Args &&... args)
| Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream of aie::mask values.
template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, NativeDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_from_native (Args &&... args)
| Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.
template<Mask M, data_layout Layout = data_layout::row_major, NativeDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_from_native_bytes (Args &&... args)
| Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream of aie::mask values.
template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, NativeOrSlidingDim... Args> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_tensor_descriptor_from_native_bytes (Args &&... args)
| Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.
template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor> requires (arch::is(arch::Gen2))
constexpr auto | aie::make_unaligned_tensor_buffer_stream (const T *base, const TensorDescriptor &tensor_desc)
| Creates a constant tensor buffer stream for accessing unaligned multidimensional data with optimized memory addressing patterns.
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2, unsigned Elems> requires (std::is_same_v<aie_dm_resource_remove_t<T1>, aie_dm_resource_remove_t<T2>>)
T1 * | aie::store_floor_bytes_v (T1 *ptr, const vector< T2, Elems > &v, size_t bytes)
| Store a vector of Elems size whose elements have type T.
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2, unsigned Elems> requires (std::is_same_v<aie_dm_resource_remove_t<T1>, aie_dm_resource_remove_t<T2>>)
T1 * | aie::store_floor_v (T1 *ptr, const vector< T2, Elems > &v, unsigned n=Elems)
| Store a vector of Elems size whose elements have type T.
template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2> requires (std::is_same_v<T2, aie_dm_resource_remove_t<T1>>)
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.
template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2, unsigned Elems> requires (std::is_same_v<aie_dm_resource_remove_t<T1>, aie_dm_resource_remove_t<T2>>)
T1 * | aie::store_v (T1 *ptr, const vector< T2, Elems > &v)
| Store a vector of Elems size whose elements have type T.

## Variables
static constexpr unsigned | aie::vector_decl_align = detail::vector_decl_align
| Specifies the minimum alignment requirement for vector loads and stores.
template<DecoratedElemBaseType T, unsigned Elems>
static constexpr unsigned | aie::vector_ldst_align_elems_v = (detail::vector_ldst_align_v<T, Elems> * 8) / detail::type_bits_v<T>
| Specifies the minimum alignment requirement in elements for vector loads and stores.
template<DecoratedElemBaseType T, unsigned Elems>
static constexpr unsigned | aie::vector_ldst_align_v = detail::vector_ldst_align_v<T, Elems>
| Specifies the minimum alignment requirement in bytes for vector loads and stores.
enum class | aie_dm_resource
| Specifies a memory resource to bind a specific memory access (load, store, ...). More...

## Class Documentation

## ◆ aie::circular_iterator

class aie::circular_iterator

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
class aie::circular_iterator< T, Size, Resource >

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

The interface meets std::forward_iterator.

Template Parameters

  T | Type of the elements in the array.
  Size | Size of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

### Public Types
using | difference_type = ptrdiff_t
using | iterator_category = std::forward_iterator_tag
using | pointer = value_type*
using | reference = value_type&
using | value_type = T
### Public Member Functions
bool | operator!= (const circular_iterator &other) const
| Return true if the two iterators reference different values.
reference | operator* ()
| Accesses the value in the iterator.
circular_iterator & | operator++ ()
| Pre-fix increment: advances the iterator one step.
circular_iterator | operator++ (int)
| Post-fix increment: advances the iterator one step and returns a copy of its old state.
pointer | operator-> ()
| Accesses the value in the iterator.
bool | operator== (const circular_iterator &other) const
| Return true if the two iterators reference the same value.

#### Member Typedef Documentation

## ◆ difference_type

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::circular_iterator< T, Size, Resource >::difference_type = ptrdiff_t

## ◆ iterator_category

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::circular_iterator< T, Size, Resource >::iterator_category = std::forward_iterator_tag

## ◆ pointer

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::circular_iterator< T, Size, Resource >::pointer = value_type*

## ◆ reference

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::circular_iterator< T, Size, Resource >::reference = value_type&

## ◆ value_type

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::circular_iterator< T, Size, Resource >::value_type = T

#### Member Function Documentation

## ◆ operator!=()

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::circular_iterator< T, Size, Resource >::operator!= | ( | const circular_iterator< T, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference different values.

## ◆ operator*()

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::circular_iterator< T, Size, Resource >::operator* | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator++() [1/2]

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

circular_iterator & aie::circular_iterator< T, Size, Resource >::operator++ | ( |  | ) |
| inline

Pre-fix increment: advances the iterator one step.

Every time the iterator reaches the end, it jumps back to its base position.

Returns
  a reference to the iterator

See also
  operator++(int)

## ◆ operator++() [2/2]

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

circular_iterator aie::circular_iterator< T, Size, Resource >::operator++ | ( | int |  | ) |
| inline

Post-fix increment: advances the iterator one step and returns a copy of its old state.

Returns
  a copy of the iterator before the increment operation took place.

See also
  operator++()

## ◆ operator->()

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

pointer aie::circular_iterator< T, Size, Resource >::operator-> | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator==()

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::circular_iterator< T, Size, Resource >::operator== | ( | const circular_iterator< T, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference the same value.

## ◆ aie::random_circular_iterator

class aie::random_circular_iterator

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>
class aie::random_circular_iterator< T, Size, 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 std::random_access_iterator.

Template Parameters

  T | Type of the elements in the array.
  Size | Size of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

### Public Types
using | difference_type = ptrdiff_t
using | iterator_category = std::random_access_iterator_tag
using | pointer = value_type*
using | reference = value_type&
using | value_type = T
### Public Member Functions
bool | operator!= (const random_circular_iterator &other) const
| Return true if the two iterators reference different values.
reference | operator* ()
| Accesses the value in the iterator.
random_circular_iterator | operator+ (difference_type off) const
| Returns a copy of the iterator that is located a number of steps ahead.
random_circular_iterator & | operator++ ()
| Pre-fix increment: advances the iterator one step.
random_circular_iterator | operator++ (int)
| Post-fix increment: advances the iterator one step and returns a copy of its old state.
random_circular_iterator | operator+= (difference_type off)
| Moves the iterator a number of steps forward.
random_circular_iterator | operator- (difference_type off) const
| Returns a copy of the iterator that is located a number of steps behind.
random_circular_iterator | operator-= (difference_type off)
| Moves the iterator a number of steps back.
pointer | operator-> ()
| Accesses the value in the iterator.
bool | operator== (const random_circular_iterator &other) const
| Return true if the two iterators reference the same value.
reference | operator[] (difference_type off)
| Accesses the value a number of steps away from the iterator.

#### Member Typedef Documentation

## ◆ difference_type

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::random_circular_iterator< T, Size, Resource >::difference_type = ptrdiff_t

## ◆ iterator_category

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::random_circular_iterator< T, Size, Resource >::iterator_category = std::random_access_iterator_tag

## ◆ pointer

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::random_circular_iterator< T, Size, Resource >::pointer = value_type*

## ◆ reference

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::random_circular_iterator< T, Size, Resource >::reference = value_type&

## ◆ value_type

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::random_circular_iterator< T, Size, Resource >::value_type = T

#### Member Function Documentation

## ◆ operator!=()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::random_circular_iterator< T, Size, Resource >::operator!= | ( | const random_circular_iterator< T, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference different values.

## ◆ operator*()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::random_circular_iterator< T, Size, Resource >::operator* | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator+()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

random_circular_iterator aie::random_circular_iterator< T, Size, Resource >::operator+ | ( | difference_type | off | ) | const
| inline

Returns a copy of the iterator that is located a number of steps ahead.

## ◆ operator++() [1/2]

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

random_circular_iterator & aie::random_circular_iterator< T, Size, Resource >::operator++ | ( |  | ) |
| inline

Pre-fix increment: advances the iterator one step.

Every time the iterator reaches the end, it jumps back to its base position.

Returns
  a reference to the iterator

See also
  operator++(int)

## ◆ operator++() [2/2]

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

random_circular_iterator aie::random_circular_iterator< T, Size, Resource >::operator++ | ( | int |  | ) |
| inline

Post-fix increment: advances the iterator one step and returns a copy of its old state.

Returns
  a copy of the iterator before the increment operation took place.

See also
  operator++()

## ◆ operator+=()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

random_circular_iterator aie::random_circular_iterator< T, Size, Resource >::operator+= | ( | difference_type | off | ) |
| inline

Moves the iterator a number of steps forward.

## ◆ operator-()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

random_circular_iterator aie::random_circular_iterator< T, Size, Resource >::operator- | ( | difference_type | off | ) | const
| inline

Returns a copy of the iterator that is located a number of steps behind.

## ◆ operator-=()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

random_circular_iterator aie::random_circular_iterator< T, Size, Resource >::operator-= | ( | difference_type | off | ) |
| inline

Moves the iterator a number of steps back.

## ◆ operator->()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

pointer aie::random_circular_iterator< T, Size, Resource >::operator-> | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator==()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::random_circular_iterator< T, Size, Resource >::operator== | ( | const random_circular_iterator< T, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference the same value.

## ◆ operator[]()

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::random_circular_iterator< T, Size, Resource >::operator[] | ( | difference_type | off | ) |
| inline

Accesses the value a number of steps away from the iterator.

## ◆ aie::sparse_vector_input_buffer_stream

class aie::sparse_vector_input_buffer_stream

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::sparse_vector_input_buffer_stream< T, Elems, Resource >

Implements an input stream that reads sparse vectors from a memory buffer.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the sparse vector.
  Resource | Data Memory resource to be used for the access when reading from the buffer.

## ◆ aie::unaligned_vector_input_buffer_stream

class aie::unaligned_vector_input_buffer_stream

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::unaligned_vector_input_buffer_stream< T, Elems, Resource >

Implements an input stream that reads from a memory buffer with vector granularity.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector.
  Resource | Data Memory resource to be used for the access when reading from the buffer.

### Public Types
using | vector_type = typename base_type::vector_type
### Public Member Functions
constexpr unaligned_vector_input_buffer_stream & | operator>> (vector_type &v)
| Returns the value from the buffer stream and increments the stream state.
constexpr vector_type | pop ()
| Returns the value from the buffer stream and increments the stream state.

#### Member Typedef Documentation

## ◆ vector_type

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_input_buffer_stream< T, Elems, Resource >::vector_type = typename base_type::vector_type

#### Member Function Documentation

## ◆ operator>>()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

unaligned_vector_input_buffer_stream & aie::unaligned_vector_input_buffer_stream< T, Elems, Resource >::operator>> | ( | vector_type & | v | ) |
| inline constexpr

Returns the value from the buffer stream and increments the stream state.

See also
  pop()

## ◆ pop()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_type aie::unaligned_vector_input_buffer_stream< T, Elems, Resource >::pop | ( |  | ) |
| inline constexpr

Returns the value from the buffer stream and increments the stream state.

## ◆ aie::unaligned_vector_iterator

class aie::unaligned_vector_iterator

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::unaligned_vector_iterator< T, Elems, Resource >

Implements an iterator that traverses an array using vectors instead of scalar values.

The interface meets random access iterator.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

### Public Types
using | difference_type = ptrdiff_t
using | iterator_category = std::random_access_iterator_tag
using | pointer = std::conditional_t<std::is_const_v<T>, const value_type *, value_type *>
using | reference = std::conditional_t<std::is_const_v<T>, const value_type &, value_type &>
using | value_type = vector_type
### Public Member Functions
bool | operator!= (const unaligned_vector_iterator &other) const
| Return true if the two iterators reference different values.
vector_ref_type | operator* ()
| Accesses the value in the iterator.
unaligned_vector_iterator & | operator++ ()
| Pre-fix increment: advances the iterator one step.
unaligned_vector_iterator | operator++ (int)
| Post-fix increment: advances the iterator one step and returns a copy of its old state.
pointer | operator-> ()
| Accesses the value in the iterator.
bool | operator== (const unaligned_vector_iterator &other) const
| Return true if the two iterators reference the same value.

#### Member Typedef Documentation

## ◆ difference_type

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_iterator< T, Elems, Resource >::difference_type = ptrdiff_t

## ◆ iterator_category

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_iterator< T, Elems, Resource >::iterator_category = std::random_access_iterator_tag

## ◆ pointer

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_iterator< T, Elems, Resource >::pointer = std::conditional_t<std::is_const_v<T>, const value_type *, value_type *>

## ◆ reference

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_iterator< T, Elems, Resource >::reference = std::conditional_t<std::is_const_v<T>, const value_type &, value_type &>

## ◆ value_type

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_iterator< T, Elems, Resource >::value_type = vector_type

#### Member Function Documentation

## ◆ operator!=()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::unaligned_vector_iterator< T, Elems, Resource >::operator!= | ( | const unaligned_vector_iterator< T, Elems, Resource > & | other | ) | const
| inline

Return true if the two iterators reference different values.

## ◆ operator*()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_ref_type aie::unaligned_vector_iterator< T, Elems, Resource >::operator* | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator++() [1/2]

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

unaligned_vector_iterator & aie::unaligned_vector_iterator< T, Elems, Resource >::operator++ | ( |  | ) |
| inline

Pre-fix increment: advances the iterator one step.

Returns
  a reference to the iterator

See also
  operator++(int)

## ◆ operator++() [2/2]

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

unaligned_vector_iterator aie::unaligned_vector_iterator< T, Elems, Resource >::operator++ | ( | int |  | ) |
| inline

Post-fix increment: advances the iterator one step and returns a copy of its old state.

Returns
  a copy of the iterator before the increment operation took place.

See also
  operator++()

## ◆ operator->()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

pointer aie::unaligned_vector_iterator< T, Elems, Resource >::operator-> | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator==()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::unaligned_vector_iterator< T, Elems, Resource >::operator== | ( | const unaligned_vector_iterator< T, Elems, Resource > & | other | ) | const
| inline

Return true if the two iterators reference the same value.

## ◆ aie::unaligned_vector_output_buffer_stream

class aie::unaligned_vector_output_buffer_stream

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::unaligned_vector_output_buffer_stream< T, Elems, Resource >

Implements an output stream that writes into a memory buffer with vector granularity.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector.
  Resource | Data Memory resource to be used for the access when reading from the buffer.

### Public Types
using | vector_type = typename base_type::vector_type
### Public Member Functions
constexpr unaligned_vector_output_buffer_stream & | operator<< (const vector_type &v)
| Writes the value to the buffer stream.
constexpr void | push (const vector_type &v)
| Writes the value to the buffer stream.

#### Member Typedef Documentation

## ◆ vector_type

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::unaligned_vector_output_buffer_stream< T, Elems, Resource >::vector_type = typename base_type::vector_type

#### Member Function Documentation

## ◆ operator<<()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

unaligned_vector_output_buffer_stream & aie::unaligned_vector_output_buffer_stream< T, Elems, Resource >::operator<< | ( | const vector_type & | v | ) |
| inline constexpr

Writes the value to the buffer stream.

See also
  push()

## ◆ push()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

void aie::unaligned_vector_output_buffer_stream< T, Elems, Resource >::push | ( | const vector_type & | v | ) |
| inline constexpr

Writes the value to the buffer stream.

## ◆ aie::vector_circular_iterator

class aie::vector_circular_iterator

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>
class aie::vector_circular_iterator< T, Elems, Size, Resource >

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

The interface meets std::forward_iterator.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector returned when dereferencing the iterator.
  Size | Size of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

### Public Types
using | difference_type = ptrdiff_t
using | iterator_category = std::forward_iterator_tag
using | pointer = std::conditional_t<std::is_const_v<T>, const vector_type *, vector_type *>
using | reference = std::conditional_t<std::is_const_v<T>, const vector_type &, vector_type &>
using | value_type = vector_type
### Public Member Functions
bool | operator!= (const vector_circular_iterator &other) const
| Return true if the two iterators reference different values.
reference | operator* ()
| Accesses the value in the iterator.
vector_circular_iterator & | operator++ ()
| Pre-fix increment: advances the iterator one step.
vector_circular_iterator | operator++ (int)
| Post-fix increment: advances the iterator one step and returns a copy of its old state.
pointer | operator-> ()
| Accesses the value in the iterator.
bool | operator== (const vector_circular_iterator &other) const
| Return true if the two iterators reference the same value.

#### Member Typedef Documentation

## ◆ difference_type

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_circular_iterator< T, Elems, Size, Resource >::difference_type = ptrdiff_t

## ◆ iterator_category

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_circular_iterator< T, Elems, Size, Resource >::iterator_category = std::forward_iterator_tag

## ◆ pointer

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_circular_iterator< T, Elems, Size, Resource >::pointer = std::conditional_t<std::is_const_v<T>, const vector_type *, vector_type *>

## ◆ reference

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_circular_iterator< T, Elems, Size, Resource >::reference = std::conditional_t<std::is_const_v<T>, const vector_type &, vector_type &>

## ◆ value_type

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_circular_iterator< T, Elems, Size, Resource >::value_type = vector_type

#### Member Function Documentation

## ◆ operator!=()

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::vector_circular_iterator< T, Elems, Size, Resource >::operator!= | ( | const vector_circular_iterator< T, Elems, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference different values.

## ◆ operator*()

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::vector_circular_iterator< T, Elems, Size, Resource >::operator* | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator++() [1/2]

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

vector_circular_iterator & aie::vector_circular_iterator< T, Elems, Size, Resource >::operator++ | ( |  | ) |
| inline

Pre-fix increment: advances the iterator one step.

Every time the iterator reaches the end, it jumps back to its base position.

Returns
  a reference to the iterator

See also
  operator++(int)

## ◆ operator++() [2/2]

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

vector_circular_iterator aie::vector_circular_iterator< T, Elems, Size, Resource >::operator++ | ( | int |  | ) |
| inline

Post-fix increment: advances the iterator one step and returns a copy of its old state.

Returns
  a copy of the iterator before the increment operation took place.

See also
  operator++()

## ◆ operator->()

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

pointer aie::vector_circular_iterator< T, Elems, Size, Resource >::operator-> | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator==()

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::vector_circular_iterator< T, Elems, Size, Resource >::operator== | ( | const vector_circular_iterator< T, Elems, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference the same value.

## ◆ aie::vector_input_buffer_stream

class aie::vector_input_buffer_stream

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::vector_input_buffer_stream< T, Elems, Resource >

Implements an input stream that reads from a memory buffer with vector granularity.

The buffer being traversed needs to meet the alignment requirements to load vectors.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector.
  Resource | Data Memory resource to be used for the access when reading from the buffer.

### Public Types
using | vector_type = typename base_type::vector_type
### Public Member Functions
constexpr vector_input_buffer_stream & | operator>> (vector_type &v)
| Returns the value from the buffer stream and increments the stream state.
constexpr vector_type | pop ()
| Returns the value from the buffer stream and increments the stream state.

#### Member Typedef Documentation

## ◆ vector_type

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_input_buffer_stream< T, Elems, Resource >::vector_type = typename base_type::vector_type

#### Member Function Documentation

## ◆ operator>>()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_input_buffer_stream & aie::vector_input_buffer_stream< T, Elems, Resource >::operator>> | ( | vector_type & | v | ) |
| inline constexpr

Returns the value from the buffer stream and increments the stream state.

See also
  pop()

## ◆ pop()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_type aie::vector_input_buffer_stream< T, Elems, Resource >::pop | ( |  | ) |
| inline constexpr

Returns the value from the buffer stream and increments the stream state.

## ◆ aie::vector_iterator

class aie::vector_iterator

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::vector_iterator< T, Elems, Resource >

Implements an iterator that traverses an array using vectors instead of scalar values.

The buffer being traversed needs to meet the alignment requirements to load/store vectors.

The interface meets random access iterator.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

### Public Types
using | difference_type = ptrdiff_t
using | iterator_category = std::random_access_iterator_tag
using | pointer = std::conditional_t<std::is_const_v<T>, const value_type *, value_type *>
using | reference = std::conditional_t<std::is_const_v<T>, const value_type &, value_type &>
using | value_type = vector_type
### Public Member Functions
bool | operator!= (const vector_iterator &other) const
| Return true if the two iterators reference different values.
reference | operator* ()
| Accesses the value in the iterator.
vector_iterator | operator+ (difference_type off) const
| Returns a copy of the iterator that is located a number of steps ahead.
vector_iterator & | operator++ ()
| Pre-fix increment: advances the iterator one step.
vector_iterator | operator++ (int)
| Post-fix increment: advances the iterator one step and returns a copy of its old state.
vector_iterator | operator+= (difference_type off)
| Moves the iterator a number of steps forward.
vector_iterator | operator- (difference_type off) const
| Returns a copy of the iterator that is located a number of steps behind.
vector_iterator | operator-= (difference_type off)
| Moves the iterator a number of steps back.
pointer | operator-> ()
| Accesses the value in the iterator.
bool | operator== (const vector_iterator &other) const
| Return true if the two iterators reference the same value.
reference | operator[] (difference_type off)
| Accesses the value a number of steps away from the iterator.

#### Member Typedef Documentation

## ◆ difference_type

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_iterator< T, Elems, Resource >::difference_type = ptrdiff_t

## ◆ iterator_category

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_iterator< T, Elems, Resource >::iterator_category = std::random_access_iterator_tag

## ◆ pointer

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_iterator< T, Elems, Resource >::pointer = std::conditional_t<std::is_const_v<T>, const value_type *, value_type *>

## ◆ reference

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_iterator< T, Elems, Resource >::reference = std::conditional_t<std::is_const_v<T>, const value_type &, value_type &>

## ◆ value_type

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_iterator< T, Elems, Resource >::value_type = vector_type

#### Member Function Documentation

## ◆ operator!=()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::vector_iterator< T, Elems, Resource >::operator!= | ( | const vector_iterator< T, Elems, Resource > & | other | ) | const
| inline

Return true if the two iterators reference different values.

## ◆ operator*()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::vector_iterator< T, Elems, Resource >::operator* | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator+()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_iterator aie::vector_iterator< T, Elems, Resource >::operator+ | ( | difference_type | off | ) | const
| inline

Returns a copy of the iterator that is located a number of steps ahead.

## ◆ operator++() [1/2]

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_iterator & aie::vector_iterator< T, Elems, Resource >::operator++ | ( |  | ) |
| inline

Pre-fix increment: advances the iterator one step.

Returns
  a reference to the iterator

See also
  operator++(int)

## ◆ operator++() [2/2]

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_iterator aie::vector_iterator< T, Elems, Resource >::operator++ | ( | int |  | ) |
| inline

Post-fix increment: advances the iterator one step and returns a copy of its old state.

Returns
  a copy of the iterator before the increment operation took place.

See also
  operator++()

## ◆ operator+=()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_iterator aie::vector_iterator< T, Elems, Resource >::operator+= | ( | difference_type | off | ) |
| inline

Moves the iterator a number of steps forward.

## ◆ operator-()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_iterator aie::vector_iterator< T, Elems, Resource >::operator- | ( | difference_type | off | ) | const
| inline

Returns a copy of the iterator that is located a number of steps behind.

## ◆ operator-=()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_iterator aie::vector_iterator< T, Elems, Resource >::operator-= | ( | difference_type | off | ) |
| inline

Moves the iterator a number of steps back.

## ◆ operator->()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

pointer aie::vector_iterator< T, Elems, Resource >::operator-> | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator==()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::vector_iterator< T, Elems, Resource >::operator== | ( | const vector_iterator< T, Elems, Resource > & | other | ) | const
| inline

Return true if the two iterators reference the same value.

## ◆ operator[]()

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::vector_iterator< T, Elems, Resource >::operator[] | ( | difference_type | off | ) |
| inline

Accesses the value a number of steps away from the iterator.

## ◆ aie::vector_output_buffer_stream

class aie::vector_output_buffer_stream

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>
class aie::vector_output_buffer_stream< T, Elems, Resource >

Implements an output stream that writes into a memory buffer with vector granularity.

The buffer being traversed needs to meet the alignment requirements to store vectors.

Template Parameters

  T | Type of the elements in the array.
  Elems | Size of the vector.
  Resource | Data Memory resource to be used for the access when reading from the buffer.

### Public Types
using | vector_type = typename base_type::vector_type
### Public Member Functions
constexpr vector_output_buffer_stream & | operator<< (const vector_type &v)
| Writes the value to the buffer stream.
constexpr void | push (const vector_type &v)
| Writes the value to the buffer stream.

#### Member Typedef Documentation

## ◆ vector_type

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_output_buffer_stream< T, Elems, Resource >::vector_type = typename base_type::vector_type

#### Member Function Documentation

## ◆ operator<<()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

vector_output_buffer_stream & aie::vector_output_buffer_stream< T, Elems, Resource >::operator<< | ( | const vector_type & | v | ) |
| inline constexpr

Writes the value to the buffer stream.

See also
  push()

## ◆ push()

template<DecoratedElemBaseType T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

void aie::vector_output_buffer_stream< T, Elems, Resource >::push | ( | const vector_type & | v | ) |
| inline constexpr

Writes the value to the buffer stream.

## ◆ aie::vector_random_circular_iterator

class aie::vector_random_circular_iterator

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>
class aie::vector_random_circular_iterator< T, Elems, Size, 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

  T | Type of the elements in the array.
  Elems | Size of the vector returned when dereferencing the iterator.
  Size | Size of the array if it is different than dynamic_extent. Otherwise, the size is not known at compile time.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

### Public Types
using | difference_type = ptrdiff_t
using | iterator_category = std::forward_iterator_tag
using | pointer = std::conditional_t<std::is_const_v<T>, const value_type *, value_type *>
using | reference = std::conditional_t<std::is_const_v<T>, const value_type &, value_type &>
using | value_type = vector_type
### Public Member Functions
bool | operator!= (const vector_random_circular_iterator &other) const
| Return true if the two iterators reference different values.
reference | operator* ()
| Accesses the value in the iterator.
vector_random_circular_iterator | operator+ (difference_type off) const
| Returns a copy of the iterator that is located a number of steps ahead.
vector_random_circular_iterator & | operator++ ()
| Pre-fix increment: advances the iterator one step.
vector_random_circular_iterator | operator++ (int)
| Post-fix increment: advances the iterator one step and returns a copy of its old state.
vector_random_circular_iterator | operator+= (difference_type off)
| Moves the iterator a number of steps forward.
vector_random_circular_iterator | operator- (difference_type off) const
| Returns a copy of the iterator that is located a number of steps behind.
vector_random_circular_iterator | operator-= (difference_type off)
| Moves the iterator a number of steps back.
pointer | operator-> ()
| Accesses the value in the iterator.
bool | operator== (const vector_random_circular_iterator &other) const
| Return true if the two iterators reference the same value.
reference | operator[] (difference_type off)
| Accesses the value a number of steps away from the iterator.

#### Member Typedef Documentation

## ◆ difference_type

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_random_circular_iterator< T, Elems, Size, Resource >::difference_type = ptrdiff_t

## ◆ iterator_category

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_random_circular_iterator< T, Elems, Size, Resource >::iterator_category = std::forward_iterator_tag

## ◆ pointer

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_random_circular_iterator< T, Elems, Size, Resource >::pointer = std::conditional_t<std::is_const_v<T>, const value_type *, value_type *>

## ◆ reference

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_random_circular_iterator< T, Elems, Size, Resource >::reference = std::conditional_t<std::is_const_v<T>, const value_type &, value_type &>

## ◆ value_type

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::vector_random_circular_iterator< T, Elems, Size, Resource >::value_type = vector_type

#### Member Function Documentation

## ◆ operator!=()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator!= | ( | const vector_random_circular_iterator< T, Elems, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference different values.

## ◆ operator*()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator* | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator+()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

vector_random_circular_iterator aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator+ | ( | difference_type | off | ) | const
| inline

Returns a copy of the iterator that is located a number of steps ahead.

## ◆ operator++() [1/2]

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

vector_random_circular_iterator & aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator++ | ( |  | ) |
| inline

Pre-fix increment: advances the iterator one step.

Every time the iterator reaches the end, it jumps back to its base position.

Returns
  a reference to the iterator

See also
  operator++(int)

## ◆ operator++() [2/2]

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

vector_random_circular_iterator aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator++ | ( | int |  | ) |
| inline

Post-fix increment: advances the iterator one step and returns a copy of its old state.

Returns
  a copy of the iterator before the increment operation took place.

See also
  operator++()

## ◆ operator+=()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

vector_random_circular_iterator aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator+= | ( | difference_type | off | ) |
| inline

Moves the iterator a number of steps forward.

## ◆ operator-()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

vector_random_circular_iterator aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator- | ( | difference_type | off | ) | const
| inline

Returns a copy of the iterator that is located a number of steps behind.

## ◆ operator-=()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

vector_random_circular_iterator aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator-= | ( | difference_type | off | ) |
| inline

Moves the iterator a number of steps back.

## ◆ operator->()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

pointer aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator-> | ( |  | ) |
| inline

Accesses the value in the iterator.

## ◆ operator==()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

bool aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator== | ( | const vector_random_circular_iterator< T, Elems, Size, Resource > & | other | ) | const
| inline

Return true if the two iterators reference the same value.

## ◆ operator[]()

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

reference aie::vector_random_circular_iterator< T, Elems, Size, Resource >::operator[] | ( | difference_type | off | ) |
| inline

Accesses the value a number of steps away from the iterator.

## Typedef Documentation

## ◆ const_circular_iterator

template<typename T, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::const_circular_iterator = circular_iterator<const T, Size, Resource>

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

## ◆ const_random_circular_iterator

template<typename T, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::const_random_circular_iterator = random_circular_iterator<const T, Size, Resource>

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

## ◆ const_unaligned_vector_iterator

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::const_unaligned_vector_iterator = unaligned_vector_iterator<const std::remove_const_t<T>, Elems, Resource>

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

## ◆ const_vector_circular_iterator

template<typename T, unsigned Elems, size_t Size = dynamic_extent, aie_dm_resource Resource = aie_dm_resource::none>

using aie::const_vector_circular_iterator = vector_circular_iterator<const T, Elems, Size, Resource>

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

## ◆ const_vector_iterator

template<typename T, unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none>

using aie::const_vector_iterator = vector_iterator<const std::remove_const_t<T>, Elems, Resource>

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

## ◆ const_vector_random_circular_iterator

template<typename T, unsigned Elems, size_t Size, aie_dm_resource Resource = aie_dm_resource::none>

using aie::const_vector_random_circular_iterator = vector_random_circular_iterator<const T, Elems, Size, Resource>

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

## Enumeration Type Documentation

## ◆ aie_dm_resource

enum class aie_dm_resource
| strong

Specifies a memory resource to bind a specific memory access (load, store, ...).

Memory accesses sharing a resource will never execute in parallel.

See also
  load_v
  store_v
  begin_vector

Enumerator
none | No resource is bound.
a | Memory access is bound to resource a.
b | Memory access is bound to resource b.
c | Memory access is bound to resource c.
d | Memory access is bound to resource d.
stack | Memory access is bound to resource stack.
ab | Memory access is bound to resources a and b.
ac | Memory access is bound to resources a and c.
ad | Memory access is bound to resources a and d.
bc | Memory access is bound to resources b and c.
bd | Memory access is bound to resources b and d.
cd | Memory access is bound to resources c and d.

## Function Documentation

## ◆ begin() [1/2]

template<aie_dm_resource Resource, typename T>

auto aie::begin | ( | T * | base,
|  | size_t | n )
| constexpr

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

Template Parameters

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ begin() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T, unsigned Elems>

auto aie::begin | ( | T(&) | base[Elems] | ) |
| constexpr

Returns an iterator for the given statically-sized array.

Template Parameters

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ begin_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

circular_iterator< T, Elems, Resource > aie::begin_circular | ( | T * | base | ) |
| constexpr

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

Template Parameters

  Elems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T>

circular_iterator< T, dynamic_extent, Resource > 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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ begin_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>

circular_iterator< T, Elems, Resource > aie::begin_circular | ( | T(&) | base[Elems] | ) |
| constexpr

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

Template Parameters

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ begin_pattern()

template<unsigned Steps, typename T, typename... Offsets>

auto aie::begin_pattern | ( | T * | base,
|  | Offsets &&... | offsets )
| constexpr

Returns a forward iterator for the array described by the given address.

On increment, the iterator is advanced by the number of elements described in the offset argument. While the pattern iterator is a forward iterator, the offsets are described by a circular iterator. For example:

std::array<int, 16> arr;
std::iota(arr.begin(), arr.end(), 0);
auto it = aie::begin_pattern<4>(arr.data(), 2, -1, 2, 1);
for (unsigned i = 0; i < arr.size(); ++i)
printf("%d ", *it++);
aie::begin_pattern
constexpr auto begin_pattern(T *base, Offsets &&... offsets)
Returns a forward iterator for the array described by the given address.
Definition iterator.hpp:1332

will output

0 2 1 3 4 6 5 7 8 10 9 11 12 14 13 15

Parameters

  base | Starting address for the iterator.
  offsets | A parameter pack describing the stride of the iterator at each increment.

## ◆ begin_random_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

random_circular_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_random_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T>

random_circular_iterator< T, dynamic_extent, Resource > 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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ begin_random_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>

random_circular_iterator< T, Elems, Resource > 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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ begin_restrict_vector() [1/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

const_restrict_vector_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_restrict_vector() [2/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

restrict_vector_iterator< T, Elems, Resource > aie::begin_restrict_vector | ( | T * | base | ) |
| constexpr

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

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_unaligned_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

unaligned_vector_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_vector() [1/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

const_vector_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_vector() [2/2]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

vector_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting 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>

vector_circular_iterator< T, Elems, ArrayElems, Resource > aie::begin_vector_circular | ( | T * | base | ) |
| constexpr

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

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  ArrayElems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_vector_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

vector_circular_iterator< T, Elems, dynamic_extent, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ begin_vector_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>

vector_circular_iterator< T, Elems, ArrayElems, Resource > aie::begin_vector_circular | ( | T(&) | base[ArrayElems] | ) |
| constexpr

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

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ begin_vector_random_circular() [1/3]

template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

vector_random_circular_iterator< T, Elems, ArrayElems, Resource > aie::begin_vector_random_circular | ( | T * | base | ) |
| constexpr

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

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  ArrayElems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ begin_vector_random_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

vector_random_circular_iterator< T, Elems, dynamic_extent, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ begin_vector_random_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>

vector_random_circular_iterator< T, Elems, ArrayElems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ cbegin()

template<aie_dm_resource Resource, typename T>

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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ cbegin_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

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

  Elems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ cbegin_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T>

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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ cbegin_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>

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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ cbegin_pattern()

template<unsigned Steps, typename T, typename... Offsets>

const_pattern_iterator< T, Steps > aie::cbegin_pattern | ( | const T * | base,
|  | Offsets &&... | offsets )
| constexpr

Similar to begin_pattern, but the returned iterator is constant.

Parameters

  base | Starting address for the iterator.
  offsets | A parameter pack describing the stride of the iterator at each increment.

See also
  begin_pattern

## ◆ cbegin_random_circular() [1/3]

template<size_t Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

const_random_circular_iterator< T, Elems, Resource > aie::cbegin_random_circular | ( | const T * | base | ) |
| constexpr

Similar to begin_random_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ cbegin_random_circular() [2/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T>

const_random_circular_iterator< T, dynamic_extent, Resource > aie::cbegin_random_circular | ( | const T * | base,
|  | size_t | n )
| constexpr

Similar to begin_random_circular, but the returned iterator is constant.

Template Parameters

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ cbegin_random_circular() [3/3]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t Elems>

const_random_circular_iterator< T, Elems > aie::cbegin_random_circular | ( | const T(&) | base[Elems] | ) |
| constexpr

Similar to begin_random_circular, but the returned iterator is constant.

Template Parameters

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ cbegin_restrict_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

const_restrict_vector_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ cbegin_unaligned_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

const_unaligned_vector_iterator< T, Elems, Resource > 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

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ cbegin_vector()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

const_vector_iterator< T, Elems, Resource > aie::cbegin_vector | ( | const T * | base | ) |
| constexpr

Same as begin_vector.

The returned iterator is const.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.

Parameters

  base | Starting 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>

const_vector_circular_iterator< T, Elems, ArrayElems, Resource > aie::cbegin_vector_circular | ( | const T * | base | ) |
| constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  ArrayElems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ cbegin_vector_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

const_vector_circular_iterator< T, Elems, dynamic_extent, Resource > aie::cbegin_vector_circular | ( | const T * | base,
|  | size_t | n )
| constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ cbegin_vector_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>

const_vector_circular_iterator< T, Elems, ArrayElems, Resource > aie::cbegin_vector_circular | ( | const T(&) | base[ArrayElems] | ) |
| constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ cbegin_vector_random_circular() [1/3]

template<unsigned Elems, size_t ArrayElems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

const_vector_random_circular_iterator< T, Elems, ArrayElems, Resource > aie::cbegin_vector_random_circular | ( | const T * | base | ) |
| constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  ArrayElems | Number of elements in the array.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.

## ◆ cbegin_vector_random_circular() [2/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T>

const_vector_random_circular_iterator< T, Elems, dynamic_extent, Resource > aie::cbegin_vector_random_circular | ( | const T * | base,
|  | size_t | n )
| constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ cbegin_vector_random_circular() [3/3]

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, typename T, size_t ArrayElems>

const_vector_random_circular_iterator< T, Elems, ArrayElems, Resource > aie::cbegin_vector_random_circular | ( | const T(&) | base[ArrayElems] | ) |
| constexpr

Similar to begin_circular, but the returned iterator is constant.

Template Parameters

  Elems | Number of elements in the vectors returned by the iterator.
  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ cend()

template<aie_dm_resource Resource = aie_dm_resource::none, typename T>

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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ end() [1/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T>

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

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Starting address for the iterator.
  n | Number of elements in the array.

## ◆ end() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, typename T, unsigned Elems>

auto aie::end | ( | T(&) | base[Elems] | ) |
| constexpr

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

Template Parameters

  Resource | Data Memory resource to be used for the access when dereferencing the iterator.

Parameters

  base | Statically-sized array.

## ◆ load_floor_bytes_v()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

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

  Elems | Size of the vector to be read from memory

Parameters

  ptr | Address data is read from
  bytes | Numbers 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>

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

  Elems | Size of the vector to be read from memory

Parameters

  ptr | Address data is read from
  n | Numbers 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>

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

  Elems | Size of the vector to be read from memory

Parameters

  ptr | Address data is read from
  aligned_elems | Number 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>

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

  ptr | Address data is read from
  aligned_elems | Number 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>

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

  Elems | Size of the vector to be read from memory

Parameters

  ptr | Address data is read from

## ◆ load_v() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T>

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

  ptr | Address data is read from

## ◆ make_restrict_tensor_buffer_stream()

template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor>
requires (arch::is(arch::Gen2))

auto aie::make_restrict_tensor_buffer_stream | ( | T *__restrict | base,
|  | const TensorDescriptor & | tensor_desc )
| constexpr

Creates a restrict tensor buffer stream for accessing multidimensional data with optimized memory addressing patterns.

This function creates a tensor buffer stream with restrict semantics, indicating to the compiler that the pointer is the only way to access the underlying data during the lifetime of the stream. This allows for more aggressive optimizations by removing potential aliasing concerns.

Template Parameters

  Resource | Data Memory resource to be used for the access when reading from the buffer. Defaults to none. If not specified, the resource will be extracted from the pointer type if available.
  Mode | Tensor buffer stream mode. Defaults to default_mode.
  T | Type of the elements in the tensor. Can be a base element type or block type.
  TensorDescriptor | Type of the tensor descriptor (automatically deduced).

Parameters

  base | Starting address for the tensor buffer stream (restrict-qualified).
  tensor_desc | Tensor descriptor created with make_tensor_descriptor that describes the shape and stride of the multidimensional tensor.

Returns
  A restrict tensor buffer stream object that can be used to read/write vectors from/to the tensor with additional optimization opportunities due to restrict semantics.

See also
  make_tensor_descriptor
  make_tensor_buffer_stream

## ◆ make_tensor_buffer_stream() [1/2]

template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_buffer_stream | ( | const T * | base,
|  | const TensorDescriptor & | tensor_desc )
| constexpr

Creates a constant tensor buffer stream for accessing multidimensional data with optimized memory addressing patterns.

This overload accepts a const pointer and creates a read-only tensor buffer stream. The returned stream can only be used for reading data from the tensor, preventing accidental modifications.

Template Parameters

  Resource | Data Memory resource to be used for the access when reading from the buffer. Defaults to none. If not specified, the resource will be extracted from the pointer type if available.
  Mode | Tensor buffer stream mode. Defaults to default_mode.
  T | Type of the elements in the tensor. Can be a base element type or block type.
  TensorDescriptor | Type of the tensor descriptor (automatically deduced).

Parameters

  base | Starting address for the tensor buffer stream (const).
  tensor_desc | Tensor descriptor created with make_tensor_descriptor that describes the shape and stride of the multidimensional tensor.

Returns
  A constant tensor buffer stream object that can be used to read vectors from the tensor.

See also
  make_tensor_descriptor
  make_restrict_tensor_buffer_stream

## ◆ make_tensor_buffer_stream() [2/2]

template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_buffer_stream | ( | T * | base,
|  | const TensorDescriptor & | tensor_desc )
| constexpr

Creates a tensor buffer stream for accessing multidimensional data with optimized memory addressing patterns.

Tensor buffer streams provide hardware-accelerated multidimensional memory access with automatic address computation for complex access patterns. They support up to 3D addressing natively, with higher-dimensional tensors automatically partitioned into nested streams.

Template Parameters

  Resource | Data Memory resource to be used for the access when reading from the buffer. Defaults to none. If not specified, the resource will be extracted from the pointer type if available.
  Mode | Tensor buffer stream mode. Defaults to default_mode.
  T | Type of the elements in the tensor. Can be a base element type or block type.
  TensorDescriptor | Type of the tensor descriptor (automatically deduced).

Parameters

  base | Starting address for the tensor buffer stream.
  tensor_desc | Tensor descriptor created with make_tensor_descriptor that describes the shape and stride of the multidimensional tensor.

Returns
  A tensor buffer stream object that can be used to read vectors from the tensor.

See also
  make_tensor_descriptor
  make_restrict_tensor_buffer_stream

## ◆ make_tensor_descriptor() [1/5]

template<Mask M, data_layout Layout = data_layout::row_major, TensorDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream of aie::mask values.

Template Parameters

  M | An aie::mask<N> type
  Layout | The memory order of the tensor.

Parameters

  args | A pack of aie::tensor_dim which describe the size and step, in units of aie::vector<T, Elems>, of each dimension of the tensor from the origin. The order is expected to be outermost to innermost.

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

## ◆ make_tensor_descriptor() [2/5]

template<typename T, unsigned Elems, typename Repr, data_layout Layout = data_layout::row_major, TensorDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Repr | A std::tuple of dimension types to specify the custom partition.
  Layout | The memory order of the tensor.

Parameters

  args | A pack of aie::tensor_dim which describe the size and step, in units of aie::vector<T, Elems>, of each dimension of the tensor from the origin. The order is expected to be outermost to innermost.

The following snippet shows a rank 6 descriptor with a custom partition of an outermost 2D stream, an inner 1D stream, which in turn has an inner 3D stream.

using Repr = std::tuple<aie::dim_2d, int, aie::dim_3d>;
auto desc = aie::make_tensor_descriptor<T, Elems, Repr>(...);

Note
  The rank specified in Repr must match the rank specified by the args list.

## ◆ make_tensor_descriptor() [3/5]

template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, TensorDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Layout | The memory order of the tensor.

Parameters

  args | A pack of aie::tensor_dim which describe the size and step, in units of aie::vector<T, Elems>, of each dimension of the tensor from the origin. The order is expected to be outermost to innermost.

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

## ◆ make_tensor_descriptor() [4/5]

template<Mask M, data_layout Layout = data_layout::row_major>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor | ( | const contiguous_dim & | arg | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream of aie::mask values.

Template Parameters

  M | An aie::mask<N> type
  Layout | The memory order of the tensor.

Parameters

  arg | A contiguous_dim object.

The returned descriptor is intended to be used to create a tensor buffer stream that tranverses memory linearly. Such a tensor buffer stream would be akin to creating a basic iterator.

## ◆ make_tensor_descriptor() [5/5]

template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor | ( | const contiguous_dim & | arg | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Layout | The memory order of the tensor.

Parameters

  arg | A contiguous_dim object.

The returned descriptor is intended to be used to create a tensor buffer stream that tranverses memory linearly. Such a tensor buffer stream would be akin to creating a basic vector iterator.

## ◆ make_tensor_descriptor_bytes() [1/3]

template<Mask M, data_layout Layout = data_layout::row_major, TensorDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_bytes | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream of aie::mask values.

Template Parameters

  M | An aie::mask<N> type
  Layout | The memory order of the tensor.

Parameters

  args | A pack of aie::tensor_dim which describe the size and step, in units of bytes, of each dimension of the tensor from the origin. The order is expected to be outermost to innermost.

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

## ◆ make_tensor_descriptor_bytes() [2/3]

template<typename T, unsigned Elems, typename Repr, data_layout Layout = data_layout::row_major, TensorDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_bytes | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Repr | A std::tuple of dimension types to specify the custom partition.
  Layout | The memory order of the tensor.

Parameters

  args | A pack of aie::tensor_dim which describe the size and step, in units of bytes, of each dimension of the tensor from the origin. The order is expected to be outermost to innermost.

The following snippet shows a rank 6 descriptor with a custom partition of an outermost 2D stream, an inner 1D stream, which in turn has an inner 3D stream.

using Repr = std::tuple<aie::dim_2d, int, aie::dim_3d>;
auto desc = aie::make_tensor_descriptor<T, Elems, Repr>(...);

Note
  The rank specified in Repr must match the rank specified by the args list.

## ◆ make_tensor_descriptor_bytes() [3/3]

template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, TensorDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_bytes | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Layout | The memory order of the tensor.

Parameters

  args | A pack of aie::tensor_dim which describe the size and step, in units of bytes, of each dimension of the tensor from the origin. The order is expected to be outermost to innermost.

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

## ◆ make_tensor_descriptor_from_native() [1/2]

template<Mask M, data_layout Layout = data_layout::row_major, NativeDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_from_native | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream of aie::mask values.

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.

Template Parameters

  M | An aie::mask<N> type
  Layout | The memory order of the tensor.

Parameters

  args | A pack of native dim types which describe the multidimensional increments,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
  aie::dim_2d, aie::dim_3d

## ◆ make_tensor_descriptor_from_native() [2/2]

template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, NativeDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_from_native | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Layout | The memory order of the tensor.

Parameters

  args | A pack of native dim types which describe the multidimensional increments,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
  aie::dim_2d, aie::dim_3d

## ◆ make_tensor_descriptor_from_native_bytes() [1/2]

template<Mask M, data_layout Layout = data_layout::row_major, NativeDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_from_native_bytes | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream of aie::mask values.

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.

Template Parameters

  M | An aie::mask<N> type
  Layout | The memory order of the tensor.

Parameters

  args | A pack of native dim types which describe the multidimensional increments, in units of bytes,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
  aie::dim_2d, aie::dim_3d

## ◆ make_tensor_descriptor_from_native_bytes() [2/2]

template<typename T, unsigned Elems = 1u, data_layout Layout = data_layout::row_major, NativeOrSlidingDim... Args>
requires (arch::is(arch::Gen2))

auto aie::make_tensor_descriptor_from_native_bytes | ( | Args &&... | args | ) |
| constexpr

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.

Template Parameters

  T | Type of the elements in the described tensor.
  Elems | Size of the vector used as part of the tensor descriptor.
  Layout | The memory order of the tensor.

Parameters

  args | A pack of native dim types which describe the multidimensional increments, in units of bytes,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
  aie::dim_2d, aie::dim_3d

## ◆ make_unaligned_tensor_buffer_stream()

template<aie_dm_resource Resource = aie_dm_resource::none, tbs_mode Mode = tbs_mode::default_mode, DecoratedElemBaseOrBlockType T, typename TensorDescriptor>
requires (arch::is(arch::Gen2))

auto aie::make_unaligned_tensor_buffer_stream | ( | const T * | base,
|  | const TensorDescriptor & | tensor_desc )
| constexpr

Creates a constant tensor buffer stream for accessing unaligned multidimensional data with optimized memory addressing patterns.

This overload accepts a const pointer and creates a read-only tensor buffer stream. The returned stream can only be used for reading data from the tensor, preventing accidental modifications.

Template Parameters

  Resource | Data Memory resource to be used for the access when reading from the buffer. Defaults to none. If not specified, the resource will be extracted from the pointer type if available.
  Mode | Tensor buffer stream mode. Defaults to default_mode.
  T | Type of the elements in the tensor. Can be a base element type or block type.
  TensorDescriptor | Type of the tensor descriptor (automatically deduced).

Parameters

  base | Starting address for the tensor buffer stream (const).
  tensor_desc | Tensor descriptor created with make_tensor_descriptor that describes the shape and stride of the multidimensional tensor.

Returns
  A constant tensor buffer stream object that can be used to read vectors from the tensor.

See also
  make_tensor_descriptor
  make_restrict_tensor_buffer_stream

## ◆ store_floor_bytes_v()

template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2, unsigned Elems>
requires (std::is_same_v<aie_dm_resource_remove_t<T1>, aie_dm_resource_remove_t<T2>>)

T1 * aie::store_floor_bytes_v | ( | T1 * | ptr,
|  | const vector< T2, Elems > & | v,
|  | size_t | bytes )

Store a vector of Elems size whose elements have type T.

The pointer will be aligned to bytes.

Parameters

  ptr | Address data is written to
  v | Vector to be written to memory
  bytes | Numbers of bytes to which the input pointer should be aligned. Must be a power of two.

## ◆ store_floor_v()

template<aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2, unsigned Elems>
requires (std::is_same_v<aie_dm_resource_remove_t<T1>, aie_dm_resource_remove_t<T2>>)

T1 * aie::store_floor_v | ( | T1 * | ptr,
|  | const vector< T2, Elems > & | v,
|  | unsigned | n = Elems )

Store a vector of Elems size whose elements have type T.

The pointer will be aligned to n * sizeof(T).

Parameters

  ptr | Address data is written to
  v | Vector to be written to memory
  n | Numbers of elements of type T to which the input pointer should be aligned. Must be a power of two.

## ◆ store_unaligned_v()

template<unsigned Elems, aie_dm_resource Resource = aie_dm_resource::none, DecoratedElemBaseType T1, ElemBaseType T2>
requires (std::is_same_v<T2, aie_dm_resource_remove_t<T1>>)

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

  ptr | Address data is written to
  v | Vector to be written to memory
  aligned_elems | Number 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, ElemBaseType T2, unsigned Elems>
requires (std::is_same_v<aie_dm_resource_remove_t<T1>, aie_dm_resource_remove_t<T2>>)

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

  ptr | Address data is written to
  v | Vector to be written to memory

## Variable Documentation

## ◆ vector_decl_align

unsigned aie::vector_decl_align = detail::vector_decl_align
| static constexpr

Specifies the minimum alignment requirement for vector loads and stores.

Example:

alignas(aie::vector_decl_align) int32 data[8];
aie::vector<int32, 8> v;
v = aie::load_v<8>(data);
v.store(data);
aie::vector::store
void store(T2 *ptr) const
Writes the contents of the vector into the given memory address.
Definition vector.hpp:563
int32
int32_t int32
Definition types.hpp:22

See also
  aie::load_v
  aie::vector<T, Elems>::load

## ◆ vector_ldst_align_elems_v

template<DecoratedElemBaseType T, unsigned Elems>

unsigned aie::vector_ldst_align_elems_v = (detail::vector_ldst_align_v<T, Elems> * 8) / detail::type_bits_v<T>
| static constexpr

Specifies the minimum alignment requirement in elements for vector loads and stores.

See also
  aie::vector_decl_align
  aie::load_v
  aie::vector<T, Elems>::load

## ◆ vector_ldst_align_v

template<DecoratedElemBaseType T, unsigned Elems>

unsigned aie::vector_ldst_align_v = detail::vector_ldst_align_v<T, Elems>
| static constexpr

Specifies the minimum alignment requirement in bytes for vector loads and stores.

See also
  aie::vector_decl_align
  aie::load_v
  aie::vector<T, Elems>::load