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

Loading...
Searching...
No Matches
utils.hpp File Reference

## Detailed Description

Utilities exposed to users.

`#include <algorithm>`
`#include <cstdio>`
`#include <cmath>`
`#include <limits>`
`#include <utility>`
`#include "vector.hpp"`
`#include "tile.hpp"`

## Classes
struct | aie::back_idx< peel_front, peel_back, BACK_N >
struct | aie::circular_index< Max >
struct | aie::front_idx< peel_front, peel_back, N >
struct | aie::loop_idx< peel_front, peel_back >
struct | aie::loop_options
| A structure containing options related to loop iteration peeling. More...
struct | aie::peel_idx< peel_front, peel_back >

## Namespaces
namespace | aie
| Base namespace for AIE operations and types.
namespace | aie::utils

## Macros
#define | __AIE_API_UTILS__HPP__
#define | AIE_API_CXX_VERSION 202002L

## Typedefs
using | aie::utils::AIE_RegFile = detail::utils::AIE_RegFile

## Functions
template<unsigned Reg = (unsigned)-1, AIE_RegFile RegFile = AIE_RegFile::Default, typename T>
auto | aie::utils::locate_in_register (const T &val)
template<unsigned Reg = (unsigned)-1, AIE_RegFile RegFile = AIE_RegFile::Default, typename T>
auto | aie::utils::locate_in_register (T &&val)
| Binds a value to a specified register.
template<unsigned StartIdx = 0, unsigned N, AIE_RegFile RegFile = AIE_RegFile::Default, typename T>
void | aie::utils::locate_in_register (T(&arr)[N])
| Binds each variable in an array to sequential registers, starting from the specified register.
template<unsigned MinIters, loop_options Opts = loop_options{}, typename Fn>
void | aie::peeled_loop (unsigned count, Fn &&fn)
| Invokes a function object a given number of times, applying peeling at the front and back of the loop.
template<unsigned MinIters, loop_options Opts = loop_options{}, bool use_pipelining, typename Fn>
void | aie::peeled_pipelined_loop (unsigned count, Fn &&fn)
template<unsigned MinIters, loop_options Opts = loop_options{}, typename Fn>
void | aie::pipelined_loop (unsigned count, Fn &&fn)
| Invokes a function object a given number of times.
template<unsigned MinIters, loop_options OptsFn1 = loop_options{}, loop_options OptsFn2 = loop_options{}, typename Fn1, typename Fn2>
void | aie::pipelined_loops (unsigned count, Fn1 &&fn1, Fn2 &&fn2)
| Invokes two function objects a given number of times.
template<unsigned MinIters, loop_options OptsFn1 = loop_options{}, loop_options OptsFn2 = loop_options{}, loop_options OptsFn3 = loop_options{}, typename Fn1, typename Fn2, typename Fn3>
void | aie::pipelined_loops (unsigned count, Fn1 &&fn1, Fn2 &&fn2, Fn3 &&fn3)
| Invokes 3 function objects a given number of times.
template<unsigned N>
void | aie::print (const aie::mask< N > &m, bool nl=false, const char *prefix=nullptr)
| Displays the contents of a mask.
template<typename C> requires (Vector<C> || Accum<C>)
void | aie::print (const C &c, bool nl=false, const char *prefix=nullptr)
| Displays the contents of a vector or an accumulator.
template<typename T, unsigned Elems> requires (!detail::is_floating_point_v<T>)
void | aie::print_fixed (const aie::vector< T, Elems > &v, int scale, bool nl=false, const char *prefix=nullptr)
| Displays the contents of a vector integers represented as real numbers in fixed point.
template<typename Matrix> requires (Vector<Matrix> || Accum<Matrix>)
void | aie::print_matrix (const Matrix &m, unsigned cols, const char *prefix=nullptr)
| Displays the contents of a vector or accumulator, arranged in a matrix layout.
template<typename T, T Start, T End, T Step = 1, typename Fn>
constexpr void | aie::unroll_for (Fn &&fn)
| Invokes a function object as many times as specified by a linear index sequence.
template<typename T, T StartY, T EndY, T StepY, T StartX, T EndX, T StepX, typename Fn>
constexpr void | aie::unroll_for_2d (Fn &&fn)
| Invokes a function object as many times as defined by a 2D index sequence.
template<unsigned Times, typename Fn>
constexpr void | aie::unroll_times (Fn &&fn)
| Invokes a function object a given number of times.
template<unsigned TimesY, unsigned TimesX, typename Fn>
constexpr void | aie::unroll_times_2d (Fn &&fn)
| Invokes a function object as many times as defined by a 2D index sequence.

## Class Documentation

## ◆ aie::circular_index

struct aie::circular_index

template<unsigned Max>
struct aie::circular_index< Max >

## Macro Definition Documentation

## ◆ __AIE_API_UTILS__HPP__

#define __AIE_API_UTILS__HPP__

## ◆ AIE_API_CXX_VERSION

#define AIE_API_CXX_VERSION 202002L