AI Engine API User Guide (AIE-API) 2025.1
Loading...
Searching...
No Matches
Configuration

Overview

Certain aspects of AI Engine behavior can be configured at runtime.

These include the sautaration behavior of the accumulators and the rounding behavior when converting accumulators to vectors.

Enumerations

enum class  aie::rounding_mode : unsigned
 Rounding modes. More...
 
enum class  aie::saturation_mode : unsigned
 Saturation modes. More...
 

Functions

static tile aie::tile::current ()
 Return an instance of tile representing the current tile.
 
uint64_t aie::tile::cycles () const
 Return the elapsed number of cycles.
 
static rounding_mode aie::get_rounding ()
 Get the current rounding mode used in accumulator to vector conversions.
 
static saturation_mode aie::get_saturation ()
 Get the current saturation mode.
 
tile_id aie::tile::global_id () const
 Return the global tile id.
 
tile_id aie::tile::id () const
 Return the tile id.
 
static void aie::set_rounding (rounding_mode m)
 Set the rounding mode used in accumulator to vector conversions.
 
static void aie::set_saturation (saturation_mode m)
 Set the saturation mode.
 
static rounding_mode aie::swap_rounding (rounding_mode m)
 Set the rounding mode used in accumulator to vector conversions and return the previously set mode.
 
static saturation_mode aie::swap_saturation (saturation_mode m)
 Set the saturation mode and return the previously set mode.
 

Enumeration Type Documentation

◆ rounding_mode

enum class aie::rounding_mode : unsigned
strong

Rounding modes.

Enumerator
floor 

Always round towards negative infinity.

ceil 

Always round towards positive infinity.

positive_inf 

Round to nearest integer, with preference to positive infinity at half-way.

negative_inf 

Round to nearest integer, with preference to negative infinity at half-way.

symmetric_inf 

Round to nearest integer, with preference away from zero at half-way.

symmetric_zero 

Round to nearest integer, with preference towards zero at half-way.

conv_even 

Round to nearest integer, with preference to even numbers.

conv_odd 

Round to nearest integer, with preference to odd numbers.

◆ saturation_mode

enum class aie::saturation_mode : unsigned
strong

Saturation modes.

Enumerator
none 

Allows values to overflow.

truncate 

Deprecated: use saturate instead.

saturate 

Retain maximum/minimum value on positive/negative overflow. Limits depend on type bit-width and if it has sign.

symmetric 

Retain maximum/minimum value on positive/negative overflow (signed types only). Max and min limits have exactly the same absolute value.

Function Documentation

◆ current()

static tile aie::tile::current ( )
inlinestatic

Return an instance of tile representing the current tile.

◆ cycles()

uint64_t aie::tile::cycles ( ) const
inline

Return the elapsed number of cycles.

◆ get_rounding()

static rounding_mode aie::get_rounding ( )
inlinestatic

Get the current rounding mode used in accumulator to vector conversions.

◆ get_saturation()

static saturation_mode aie::get_saturation ( )
inlinestatic

Get the current saturation mode.

◆ global_id()

tile_id aie::tile::global_id ( ) const
inline

Return the global tile id.

◆ id()

tile_id aie::tile::id ( ) const
inline

Return the tile id.

◆ set_rounding()

static void aie::set_rounding ( rounding_mode m)
inlinestatic

Set the rounding mode used in accumulator to vector conversions.

Parameters
mRounding mode to be set

◆ set_saturation()

static void aie::set_saturation ( saturation_mode m)
inlinestatic

Set the saturation mode.

Parameters
mSaturation mode to be set

◆ swap_rounding()

static rounding_mode aie::swap_rounding ( rounding_mode m)
inlinestatic

Set the rounding mode used in accumulator to vector conversions and return the previously set mode.

Parameters
mRounding mode to be set

◆ swap_saturation()

static saturation_mode aie::swap_saturation ( saturation_mode m)
inlinestatic

Set the saturation mode and return the previously set mode.

Parameters
mSaturation mode to be set