AI Engine API User Guide (AIE) 2021.2
Comparison

Overview

Vector comparison operations.

Functions

template<VectorVec,ElemE>
mask< Vec::size()> aie::eq(const Vec &v, E a)
More...
template<VectorVec1,VectorVec2>
mask< Vec1::size()> aie::eq(const Vec1 &v1, const Vec2 &v2)
More...
template<ElemE,VectorVec>
mask< Vec::size()> aie::eq(E a, const Vec &v)
More...
template<VectorVec1,VectorVec2>
constexpr bool aie::equal(const Vec1 &v1, const Vec2 &v2)
More...
template<RealVectorVec,RealElemE>
mask< Vec::size()> aie::ge(const Vec &v, E a)
More...
template<RealVectorVec1,RealVectorVec2>
mask< Vec1::size()> aie::ge(const Vec1 &v1, const Vec2 &v2)
More...
template<RealElemE,RealVectorVec>
mask< Vec::size()> aie::ge(E a, const Vec &v)
More...
template<RealVectorVec,RealElemE>
mask< Vec::size()> aie::gt(const Vec &v, E a)
More...
template<RealVectorVec1,RealVectorVec2>
mask< Vec1::size()> aie::gt(const Vec1 &v1, const Vec2 &v2)
More...
template<RealElemE,RealVectorVec>
mask< Vec::size()> aie::gt(E a, const Vec &v)
More...
template<RealVectorVec,RealElemE>
mask< Vec::size()> aie::le(const Vec &v, E a)
More...
template<RealVectorVec1,RealVectorVec2>
mask< Vec1::size()> aie::le(const Vec1 &v1, const Vec2 &v2)
More...
template<RealElemE,RealVectorVec>
mask< Vec::size()> aie::le(E a, const Vec &v)
More...
template<RealVectorVec,RealElemE>
mask< Vec::size()> aie::lt(const Vec &v, E a)
More...
template<RealVectorVec1,RealVectorVec2>
mask< Vec1::size()> aie::lt(const Vec1 &v1, const Vec2 &v2)
More...
template<RealElemE,RealVectorVec>
mask< Vec::size()> aie::lt(E a, const Vec &v)
More...
template<RealVectorVec,RealElemE>
auto aie::max(const Vec &v, E a) ->aie_dm_resource_remove_t< Vec >
More...
template<RealVectorVec1,RealVectorVec2>
auto aie::max(const Vec1 &v1, const Vec2 &v2) ->aie_dm_resource_remove_t< Vec1 >
More...
template<RealElemE,RealVectorVec>
auto aie::max(E a, const Vec &v) ->aie_dm_resource_remove_t< Vec >
More...
template<RealVectorVec,RealElemE>
auto aie::min(const Vec &v, E a) ->aie_dm_resource_remove_t< Vec >
More...
template<RealVectorVec1,RealVectorVec2>
auto aie::min(const Vec1 &v1, const Vec2 &v2) ->aie_dm_resource_remove_t< Vec1 >
More...
template<RealElemE,RealVectorVec>
auto aie::min(E a, const Vec &v) ->aie_dm_resource_remove_t< Vec >
More...
template<VectorVec,ElemE>
mask< Vec::size()> aie::neq(const Vec &v, E a)
More...
template<VectorVec1,VectorVec2>
mask< Vec1::size()> aie::neq(const Vec1 &v1, const Vec2 &v2)
More...
template<ElemE,VectorVec>
mask< Vec::size()> aie::neq(E a, const Vec &v)
More...
template<VectorVec1,VectorVec2>
constexpr bool aie::not_equal(const Vec1 &v1, const Vec2 &v2)
More...

Function Documentation

eq()[1/3]

template< VectorVec, ElemE>
mask aie::eq ( const Vec & v,
E a
)

Compares a value with the elements of the input vector and returns a mask that says what elements in the vector are equal to the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v[i] == a;
Parameters
v Input vector. The type must meetVector.
a Value. The type must meetElem.

eq()[2/3]

template< VectorVec1, VectorVec2>
mask aie::eq ( const Vec1 & v1,
const Vec2 & v2
)

Compares the elements of the two input vectors and returns a mask that says what elements are equal. The vectors must have the same type and size.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v1[i] == v2[i];
Parameters
v1 First input vector. The type must meetVector.
v2 Second input vector. The type must meetVector.

eq()[3/3]

template< ElemE, VectorVec>
mask aie::eq ( E a,
const Vec & v
)

Compares a value with the elements of the input vector and returns a mask that says what elements in the vector are equal to the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = a == v[i];
Parameters
a Value. The type must meetElem.
v Input vector. The type must meetVector.

equal()

template< VectorVec1, VectorVec2>
constexpr bool aie::equal ( const Vec1 & v1,
const Vec2 & v2
)
constexpr

Return whether all the elements of the two input vectors are equal. The vectors must have the same type and size.

boolout = true;
for( unsignedi = 0; i < Elems; ++i)
out = out && (v1[i] == v2[i]);
Parameters
v1 First input vector. The type must meetVector.
v2 Second input vector. The type must meetVector.

ge()[1/3]

template< RealVectorVec, RealElemE>
mask aie::ge ( const Vec & v,
E a
)

Compares the elements of the input vector with a value and returns a mask that says if the elements in the vector are greater or equal than the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v[i] >= a;
Parameters
v Input vector. The type must meetRealVector.
a Value. The type must meetRealElem.

ge()[2/3]

template< RealVectorVec1, RealVectorVec2>
mask aie::ge ( const Vec1 & v1,
const Vec2 & v2
)

Compares the elements of the two input vectors and returns a mask that says what elements from the first vector are greater or equal than the corresponding elements in the second vector. The vectors must have the same type and size.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v1[i] >= v2[i];
Parameters
v1 First input vector. The type must meetRealVector.
v2 Second input vector. The type must meetRealVector.

ge()[3/3]

template< RealElemE, RealVectorVec>
mask aie::ge ( E a,
const Vec & v
)

Compares a value with the elements of the input vector and returns a mask that says if the value is greater or equal than the elements in the vector. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = a >= v[i];
Parameters
a Value. The type must meetRealElem.
v Input vector. The type must meetRealVector.

gt()[1/3]

template< RealVectorVec, RealElemE>
mask aie::gt ( const Vec & v,
E a
)

Compares the elements of the input vector with a value and returns a mask that says if the elements in the vector are greater than the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v[i] > a;
Parameters
v Input vector. The type must meetRealVector.
a Value. The type must meetRealElem.

gt()[2/3]

template< RealVectorVec1, RealVectorVec2>
mask aie::gt ( const Vec1 & v1,
const Vec2 & v2
)

Compares the elements of the two input vectors and returns a mask that says what elements from the first vector are greater than the corresponding elements in the second vector. The vectors must have the same type and size.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v1[i] > v2[i];
Parameters
v1 First input vector. The type must meetRealVector.
v2 Second input vector. The type must meetRealVector.

gt()[3/3]

template< RealElemE, RealVectorVec>
mask aie::gt ( E a,
const Vec & v
)

Compares a value with the elements of the input vector and returns a mask that says if the value is greater than the elements in the vector. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = a > v[i];
Parameters
a Value. The type must meetRealElem.
v Input vector. The type must meetRealVector.

le()[1/3]

template< RealVectorVec, RealElemE>
mask aie::le ( const Vec & v,
E a
)

Compares the elements of the input vector with a value and returns a mask that says if the elements in the vector are smaller or equal than the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v[i] <= a;
Parameters
v Input vector. The type must meetRealVector.
a Value. The type must meetRealElem.

le()[2/3]

template< RealVectorVec1, RealVectorVec2>
mask aie::le ( const Vec1 & v1,
const Vec2 & v2
)

Compares the elements of the two input vectors and returns a mask that says what elements from the first vector are smaller or equal than the corresponding elements in the second vector. The vectors must have the same type and size.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v1[i] <= v2[i];
Parameters
v1 First input vector. The type must meetRealVector.
v2 Second input vector. The type must meetRealVector.

le()[3/3]

template< RealElemE, RealVectorVec>
mask aie::le ( E a,
const Vec & v
)

Compares a value with the elements of the input vector and returns a mask that says if the value is smaller or equal than the elements in the vector. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = a <= v[i];
Parameters
a Value. The type must meetRealElem.
v Input vector. The type must meetRealVector.

lt()[1/3]

template< RealVectorVec, RealElemE>
mask aie::lt ( const Vec & v,
E a
)

Compares the elements of the input vector with a value and returns a mask that says if the elements in the vector are smaller than the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v[i] < a;
Parameters
v Input vector. The type must meetRealVector.
a Value. The type must meetRealElem.

lt()[2/3]

template< RealVectorVec1, RealVectorVec2>
mask aie::lt ( const Vec1 & v1,
const Vec2 & v2
)

Compares the elements of the two input vectors and returns a mask that says what elements from the first vector are smaller than the corresponding elements in the second vector. The vectors must have the same type and size.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v1[i] < v2[i];
Parameters
v1 First input vector. The type must meetRealVector.
v2 Second input vector. The type must meetRealVector.

lt()[3/3]

template< RealElemE, RealVectorVec>
mask aie::lt ( E a,
const Vec & v
)

Compares a value with the elements of the input vector and returns a mask that says if the value is smaller than the elements in the vector. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = a < v[i];
Parameters
a Value. The type must meetRealElem.
v Input vector. The type must meetRealVector.

max()[1/3]

template< RealVectorVec, RealElemE>
auto aie::max ( const Vec & v,
E a
) ->aie_dm_resource_remove_t

Compares the elements of the input vector with a value and returns a vector with the maximum values. The type of the value and the type of the vector elements must be the same.

Parameters
v Input vector. The type must meetRealVector.
a Value. The type must meetRealElem.

max()[2/3]

template< RealVectorVec1, RealVectorVec2>
auto aie::max ( const Vec1 & v1,
const Vec2 & v2
) ->aie_dm_resource_remove_t

Compares the elements of the two input vectors and returns a vector with the maximum values. The vectors must have the same type and size.

Parameters
v1 First input vector. The type must meetRealVector.
v2 Second input vector. The type must meetRealVector.

max()[3/3]

template< RealElemE, RealVectorVec>
auto aie::max ( E a,
const Vec & v
) ->aie_dm_resource_remove_t

Compares a value with the elements of the input vector and returns a vector with the maximum values. The type of the value and the type of the vector elements must be the same.

Parameters
a Value. The type must meetRealElem.
v Input vector. The type must meetRealVector.

min()[1/3]

template< RealVectorVec, RealElemE>
auto aie::min ( const Vec & v,
E a
) ->aie_dm_resource_remove_t

Compares the elements of the input vector with a value and returns a vector with the minimum values. The type of the value and the type of the vector elements must be the same.

Parameters
v Input vector. The type must meetRealVector.
a Value. The type must meetRealElem.

min()[2/3]

template< RealVectorVec1, RealVectorVec2>
auto aie::min ( const Vec1 & v1,
const Vec2 & v2
) ->aie_dm_resource_remove_t

Compares the elements of the two input vectors and returns a vector with the minimum values. The vectors must have the same type and size.

Parameters
v1 First input vector. The type must meetRealVector.
v2 Second input vector. The type must meetRealVector.

min()[3/3]

template< RealElemE, RealVectorVec>
auto aie::min ( E a,
const Vec & v
) ->aie_dm_resource_remove_t

Compares a value with the elements of the input vector and returns a vector with the minimum values. The type of the value and the type of the vector elements must be the same.

Parameters
a Value. The type must meetRealElem.
v Input vector. The type must meetRealVector.

neq()[1/3]

template< VectorVec, ElemE>
mask aie::neq ( const Vec & v,
E a
)

Compares a value with the elements of the input vector and returns a mask that says what elements in the vector are different than the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v[i] != a;
Parameters
v Input vector. The type must meetVector.
a Value. The type must meetElem.

neq()[2/3]

template< VectorVec1, VectorVec2>
mask aie::neq ( const Vec1 & v1,
const Vec2 & v2
)

Compares the elements of the two input vectors and returns a mask that says what elements are different. The vectors must have the same type and size.

for( unsignedi = 0; i < Elems; ++i)
out[i] = v1[i] != v2[i];
Parameters
v1 First input vector. The type must meetVector.
v2 Second input vector. The type must meetVector.

neq()[3/3]

template< ElemE, VectorVec>
mask aie::neq ( E a,
const Vec & v
)

Compares a value with the elements of the input vector and returns a mask that says what elements in the vector are different than the value. The type of the value and the type of the vector elements must be the same.

for( unsignedi = 0; i < Elems; ++i)
out[i] = a != v[i];
Parameters
a Value. The type must meetElem.
v Input vector. The type must meetVector.

not_equal()

template< VectorVec1, VectorVec2>
constexpr bool aie::not_equal ( const Vec1 & v1,
const Vec2 & v2
)
constexpr

Return whether some elements in the two input vectors are not equal. The vectors must have the same type and size.

boolout = true;
for( unsignedi = 0; i < Elems; ++i)
out = out && (v1[i] != v2[i]);
Parameters
v1 First input vector. The type must meetVector.
v2 Second input vector. The type must meetVector.