AI Engine API User Guide (AIE) 2021.2
Operator Overloading

Overview

The AIE API provides overloading for most of the available operators. In order to use them, you need to include a special header file and use theaie::operatorsnamespace.

using namespace aie::operators;
{
return c< ( a+ b);
}
Definition:operators.hpp:60
Definition:aie_declaration.hpp:74
Definition:aie_declaration.hpp:68
Operator overloading for AIE API types, currently expects "using namespace aie::operators" in the use...

Functions

template
constexpr auto aie::operators::operator!=(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator&(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator+(const T1 &a, const T2 &b)
More...
template
constexpr T1 & aie::operators::operator+=(T1 &lhs, const T2 &rhs)
More...
template
constexpr auto aie::operators::operator-(const T &a)
More...
template
constexpr auto aie::operators::operator-(const T1 &a, const T2 &b)
More...
template
constexpr T1 & aie::operators::operator-=(T1 &lhs, const T2 &rhs)
More...
template
constexpr auto aie::operators::operator<(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator<<(const T &a, unsigned shift)
More...
template
constexpr auto aie::operators::operator<=(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator==(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator>(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator>=(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator>>(const T &a, unsigned shift)
More...
template
constexpr auto aie::operators::operator^(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator|(const T1 &a, const T2 &b)
More...
template
constexpr auto aie::operators::operator~(const T &a)
More...

Function Documentation

operator!=()

template
constexpr auto aie::operators::operator!= ( const T1 & a,
const T2 & b
)
constexpr

Not equal to comparison operator. It is equivalent toaie::neq.

operator&()

template
constexpr auto aie::operators::operator& ( const T1 & a,
const T2 & b
)
constexpr

Bitwise AND operation. It is equivalent toaie::bit_and.

operator+()

template
constexpr auto aie::operators::operator+ ( const T1 & a,
const T2 & b
)
constexpr

Addition operator. It is equivalent toaie::add.

operator+=()

template
constexpr T1& aie::operators::operator+= ( T1 & lhs,
const T2 & rhs
)
constexpr

Addition assignment operator.

operator-()[1/2]

template
constexpr auto aie::operators::operator- ( const T & a )
constexpr

Negation operator. It is equivalent toaie::neg.

operator-()[2/2]

template
constexpr auto aie::operators::operator- ( const T1 & a,
const T2 & b
)
constexpr

Subtraction operator. It is equivalent toaie::sub.

operator-=()

template
constexpr T1& aie::operators::operator-= ( T1 & lhs,
const T2 & rhs
)
constexpr

Subtraction assignment operator.

operator<()

template
constexpr auto aie::operators::operator< ( const T1 & a,
const T2 & b
)
constexpr

Less than comparison operator. It is equivalent toaie::lt.

operator<<()

template
constexpr auto aie::operators::operator<< ( const T & a,
unsigned shift
)
constexpr

Bitwise left shift operator. It is equivalent toaie::upshift.

operator<=()

template
constexpr auto aie::operators::operator<= ( const T1 & a,
const T2 & b
)
constexpr

Less than or equal comparison operator. It is equivalent toaie::le.

operator==()

template
constexpr auto aie::operators::operator== ( const T1 & a,
const T2 & b
)
constexpr

Equal to comparison operator. It is equivalent toaie::eq.

operator>()

template
constexpr auto aie::operators::operator> ( const T1 & a,
const T2 & b
)
constexpr

Greater than comparison operator. It is equivalent toaie::gt.

operator>=()

template
constexpr auto aie::operators::operator>= ( const T1 & a,
const T2 & b
)
constexpr

Greater than or equal comparison operator. It is equivalent toaie::ge.

operator>>()

template
constexpr auto aie::operators::operator>> ( const T & a,
unsigned shift
)
constexpr

Bitwise right shift operator. It is equivalent toaie::downshift.

operator^()

template
constexpr auto aie::operators::operator^ ( const T1 & a,
const T2 & b
)
constexpr

Bitwise XOR operation. It is equivalent toaie::bit_xor.

operator|()

template
constexpr auto aie::operators::operator| ( const T1 & a,
const T2 & b
)
constexpr

Bitwise OR operation. It is equivalent toaie::bit_or.

operator~()

template
constexpr auto aie::operators::operator~ ( const T & a )
constexpr

Bitwise NOT operation. It is equivalent toaie::bit_not.