AI Engine API User Guide (AIE-API) 2024.1
Loading...
Searching...
No Matches
Comparison

Overview

Vector comparison operations.

Functions

template<RealVector Vec, RealVector VecL, RealVector VecH>
requires (is_same_vector_v<Vec, VecL> && is_same_vector_v<Vec, VecH>)
auto aie::clamp (const Vec &v, const VecL &lo, const VecH &hi) -> aie_dm_resource_remove_t< Vec >
 Returns a vector whose elements are within specified lower and upper limits.
 
template<RealVector Vec, RealElem E1, RealElem E2>
requires (is_valid_elem_op_v<E1, typename Vec::value_type> && is_valid_elem_op_v<E2, typename Vec::value_type>)
auto aie::clamp (const Vec &v, E1 lo, E2 hi) -> aie_dm_resource_remove_t< Vec >
 Returns a vector whose elements are within specified lower and upper limits.
 
template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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.
 
template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::equal (const Vec &v, E a)
 Return whether all the elements of the input vector are equal to the scalar.
 
template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
constexpr bool aie::equal (const Vec1 &v1, const Vec2 &v2)
 Return whether all the elements of the two input vectors are equal.
 
template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::equal (E a, const Vec &v)
 Return whether all the elements of the input vector are equal to the scalar.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::max (const Vec &v, E a) -> aie_dm_resource_remove_t< Vec >
 Compares the elements of the input vector with a value and returns a vector with the maximum values.
 
template<RealVector Vec, RealElem E>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::max (const Vec &v, E a, bool sign) -> aie_dm_resource_remove_t< Vec >
 Compares the elements of the input vector with a value and returns a vector with the maximum values.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
auto aie::max (const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
 Compares the elements of the two input vectors and returns a vector with the maximum values.
 
template<RealVector Vec1, RealVector Vec2>
requires (arch::is(arch::AIE_ML) && is_same_vector_v<Vec1, Vec2>)
auto aie::max (const Vec1 &v1, const Vec2 &v2, bool sign) -> aie_dm_resource_remove_t< Vec1 >
 Compares the elements of the two input vectors and returns a vector with the maximum values.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::max (E a, const Vec &v) -> aie_dm_resource_remove_t< Vec >
 Compares a value with the elements of the input vector and returns a vector with the maximum values.
 
template<RealElem E, RealVector Vec>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::max (E a, const Vec &v, bool sign) -> aie_dm_resource_remove_t< Vec >
 Compares a value with the elements of the input vector and returns a vector with the maximum values.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::maxdiff (const Vec &v, E a) -> aie_dm_resource_remove_t< Vec >
 Compares the elements of the input vector with a value and returns a vector whose values are their difference if it is positive, or zero otherwise.
 
template<RealVector Vec, RealElem E>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::maxdiff (const Vec &v, E a, bool sign) -> aie_dm_resource_remove_t< Vec >
 Compares the elements of the input vector with a value and returns a vector whose values are their difference if it is positive, or zero otherwise.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
auto aie::maxdiff (const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
 Compares the elements of the two input vectors and returns a vector whose values are their difference if it is positive, or zero otherwise.
 
template<RealVector Vec1, RealVector Vec2>
requires (arch::is(arch::AIE_ML) && is_same_vector_v<Vec1, Vec2>)
auto aie::maxdiff (const Vec1 &v1, const Vec2 &v2, bool sign) -> aie_dm_resource_remove_t< Vec1 >
 Compares the elements of the two input vectors and returns a vector whose values are their difference if it is positive, or zero otherwise.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::maxdiff (E a, const Vec &v) -> aie_dm_resource_remove_t< Vec >
 Compares a value with the elements of the input vector and returns a vector whose values are their difference if it is positive, or zero otherwise.
 
template<RealElem E, RealVector Vec>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::maxdiff (E a, const Vec &v, bool sign) -> aie_dm_resource_remove_t< Vec >
 Compares a value with the elements of the input vector and returns a vector whose values are their difference if it is positive, or zero otherwise.
 
template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::min (const Vec &v, E a) -> aie_dm_resource_remove_t< Vec >
 Compares the elements of the input vector with a value and returns a vector with the minimum values.
 
template<RealVector Vec, RealElem E>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::min (const Vec &v, E a, bool sign) -> aie_dm_resource_remove_t< Vec >
 Compares the elements of the input vector with a value and returns a vector with the minimum values.
 
template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
auto aie::min (const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
 Compares the elements of the two input vectors and returns a vector with the minimum values.
 
template<RealVector Vec1, RealVector Vec2>
requires (arch::is(arch::AIE_ML) && is_same_vector_v<Vec1, Vec2>)
auto aie::min (const Vec1 &v1, const Vec2 &v2, bool sign) -> aie_dm_resource_remove_t< Vec1 >
 Compares the elements of the two input vectors and returns a vector with the minimum values.
 
template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::min (E a, const Vec &v) -> aie_dm_resource_remove_t< Vec >
 Compares a value with the elements of the input vector and returns a vector with the minimum values.
 
template<RealElem E, RealVector Vec>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::min (E a, const Vec &v, bool sign) -> aie_dm_resource_remove_t< Vec >
 Compares a value with the elements of the input vector and returns a vector with the minimum values.
 
template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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.
 
template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> 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.
 
template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::not_equal (const Vec &v, E a)
 Return whether some the elements of the input vector are not equal to the scalar.
 
template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
constexpr bool aie::not_equal (const Vec1 &v1, const Vec2 &v2)
 Return whether some elements in the two input vectors are not equal.
 
template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::not_equal (E a, const Vec &v)
 Return whether some the elements of the input vector are not equal to the scalar.
 

Function Documentation

◆ clamp() [1/2]

template<RealVector Vec, RealVector VecL, RealVector VecH>
requires (is_same_vector_v<Vec, VecL> && is_same_vector_v<Vec, VecH>)
auto aie::clamp ( const Vec &  v,
const VecL &  lo,
const VecH &  hi 
) -> aie_dm_resource_remove_t<Vec>

Returns a vector whose elements are within specified lower and upper limits.

The result of the operation is unspecified if the value of lo argument is greater than hi. The input and the boundary vectors must have the same type.

for (unsigned i = 0; i < Elems; ++i) {
auto e = max(m[i], lo[i]);
out[i] = min(e, hi[i]);
}
auto max(const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
Compares the elements of the two input vectors and returns a vector with the maximum values.
Definition aie.hpp:1907
auto min(const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
Compares the elements of the two input vectors and returns a vector with the minimum values.
Definition aie.hpp:2079
Parameters
vValues vector. The type must meet aie::RealVector.
loLower bounds vector. The type must meet aie::RealVector.
hiUpper bounds vector. The type must meet aie::RealVector.

◆ clamp() [2/2]

template<RealVector Vec, RealElem E1, RealElem E2>
requires (is_valid_elem_op_v<E1, typename Vec::value_type> && is_valid_elem_op_v<E2, typename Vec::value_type>)
auto aie::clamp ( const Vec &  v,
E1  lo,
E2  hi 
) -> aie_dm_resource_remove_t<Vec>

Returns a vector whose elements are within specified lower and upper limits.

The result of the operation is unspecified if the value of lo argument is greater than hi. The vector elements and the boundary values must have the same type.

for (unsigned i = 0; i < Elems; ++i) {
auto e = max(m[i], lo);
out[i] = min(e, hi);
}
Parameters
vInput vector. The type must meet aie::RealVector.
loSmallest value. The type must meet aie::RealElem.
hiGreatest value. The type must meet aie::RealElem.

◆ eq() [1/3]

template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::eq ( const Vec &  v,
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 (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] == a;
Parameters
vInput vector. The type must meet aie::Vector.
aValue. The type must meet aie::Elem.

◆ eq() [2/3]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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 (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] == v2[i];
Parameters
v1First input vector. The type must meet aie::Vector.
v2Second input vector. The type must meet aie::Vector.

◆ eq() [3/3]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::eq ( 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 (unsigned i = 0; i < Elems; ++i)
out[i] = a == v[i];
Parameters
aValue. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.

◆ equal() [1/3]

template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::equal ( const Vec &  v,
a 
)
constexpr

Return whether all the elements of the input vector are equal to the scalar.

bool out = true;
for (unsigned i = 0; i < Elems; ++i)
out = out && (v[i] == a);
Parameters
aInput scalar. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.

◆ equal() [2/3]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
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.

bool out = true;
for (unsigned i = 0; i < Elems; ++i)
out = out && (v1[i] == v2[i]);
Parameters
v1First input vector. The type must meet aie::Vector.
v2Second input vector. The type must meet aie::Vector.

◆ equal() [3/3]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::equal ( a,
const Vec &  v 
)
constexpr

Return whether all the elements of the input vector are equal to the scalar.

bool out = true;
for (unsigned i = 0; i < Elems; ++i)
out = out && (a == v[i]);
Parameters
aInput scalar. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.

◆ ge() [1/3]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::ge ( const Vec &  v,
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 (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] >= a;
Parameters
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.

◆ ge() [2/3]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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 (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] >= v2[i];
Parameters
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ ge() [3/3]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::ge ( 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 (unsigned i = 0; i < Elems; ++i)
out[i] = a >= v[i];
Parameters
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.

◆ gt() [1/3]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::gt ( const Vec &  v,
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 (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] > a;
Parameters
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.

◆ gt() [2/3]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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 (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] > v2[i];
Parameters
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ gt() [3/3]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::gt ( 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 (unsigned i = 0; i < Elems; ++i)
out[i] = a > v[i];
Parameters
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.

◆ le() [1/3]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::le ( const Vec &  v,
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 (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] <= a;
Parameters
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.

◆ le() [2/3]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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 (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] <= v2[i];
Parameters
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ le() [3/3]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::le ( 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 (unsigned i = 0; i < Elems; ++i)
out[i] = a <= v[i];
Parameters
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.

◆ lt() [1/3]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::lt ( const Vec &  v,
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 (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] < a;
Parameters
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.

◆ lt() [2/3]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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 (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] < v2[i];
Parameters
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ lt() [3/3]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::lt ( 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 (unsigned i = 0; i < Elems; ++i)
out[i] = a < v[i];
Parameters
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.

◆ max() [1/6]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::max ( const Vec &  v,
a 
) -> aie_dm_resource_remove_t<Vec>

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
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.

◆ max() [2/6]

template<RealVector Vec, RealElem E>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::max ( const Vec &  v,
a,
bool  sign 
) -> aie_dm_resource_remove_t<Vec>

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
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.
signWhether the inputs need to be interpreted as signed values.

◆ max() [3/6]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
auto aie::max ( const Vec1 &  v1,
const Vec2 &  v2 
) -> aie_dm_resource_remove_t<Vec1>

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
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ max() [4/6]

template<RealVector Vec1, RealVector Vec2>
requires (arch::is(arch::AIE_ML) && is_same_vector_v<Vec1, Vec2>)
auto aie::max ( const Vec1 &  v1,
const Vec2 &  v2,
bool  sign 
) -> aie_dm_resource_remove_t<Vec1>

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
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.
signWhether the inputs need to be interpreted as signed values.

◆ max() [5/6]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::max ( a,
const Vec &  v 
) -> aie_dm_resource_remove_t<Vec>

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
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.

◆ max() [6/6]

template<RealElem E, RealVector Vec>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::max ( a,
const Vec &  v,
bool  sign 
) -> aie_dm_resource_remove_t<Vec>

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
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.
signWhether the inputs need to be interpreted as signed values.

◆ maxdiff() [1/6]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::maxdiff ( const Vec &  v,
a 
) -> aie_dm_resource_remove_t<Vec>

Compares the elements of the input vector with a value and returns a vector whose values are their difference if it is positive, or zero otherwise.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] > a? v[i] - a : 0;
Parameters
vInput vector. The type must meet aie::Vector.
aValue. The type must meet aie::Elem.

◆ maxdiff() [2/6]

template<RealVector Vec, RealElem E>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::maxdiff ( const Vec &  v,
a,
bool  sign 
) -> aie_dm_resource_remove_t<Vec>

Compares the elements of the input vector with a value and returns a vector whose values are their difference if it is positive, or zero otherwise.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] > a? v[i] - a : 0;
Parameters
vInput vector. The type must meet aie::Vector.
aValue. The type must meet aie::Elem.
signWhether the inputs need to be interpreted as signed values.

◆ maxdiff() [3/6]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
auto aie::maxdiff ( const Vec1 &  v1,
const Vec2 &  v2 
) -> aie_dm_resource_remove_t<Vec1>

Compares the elements of the two input vectors and returns a vector whose values are their difference if it is positive, or zero otherwise.

The vectors must have the same type and size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] > v2[i]? v1[i] - v2[i] : 0;
Parameters
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ maxdiff() [4/6]

template<RealVector Vec1, RealVector Vec2>
requires (arch::is(arch::AIE_ML) && is_same_vector_v<Vec1, Vec2>)
auto aie::maxdiff ( const Vec1 &  v1,
const Vec2 &  v2,
bool  sign 
) -> aie_dm_resource_remove_t<Vec1>

Compares the elements of the two input vectors and returns a vector whose values are their difference if it is positive, or zero otherwise.

The vectors must have the same type and size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] > v2[i]? v1[i] - v2[i] : 0;
Parameters
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.
signWhether the inputs need to be interpreted as signed values.

◆ maxdiff() [5/6]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::maxdiff ( a,
const Vec &  v 
) -> aie_dm_resource_remove_t<Vec>

Compares a value with the elements of the input vector and returns a vector whose values are their difference if it is positive, or zero otherwise.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = a > v[i]? a - v[i] : 0;
Parameters
aValue. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.

◆ maxdiff() [6/6]

template<RealElem E, RealVector Vec>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::maxdiff ( a,
const Vec &  v,
bool  sign 
) -> aie_dm_resource_remove_t<Vec>

Compares a value with the elements of the input vector and returns a vector whose values are their difference if it is positive, or zero otherwise.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = a > v[i]? a - v[i] : 0;
Parameters
aValue. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.
signWhether the inputs need to be interpreted as signed values.

◆ min() [1/6]

template<RealVector Vec, RealElem E>
requires (is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::min ( const Vec &  v,
a 
) -> aie_dm_resource_remove_t<Vec>

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
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.

◆ min() [2/6]

template<RealVector Vec, RealElem E>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<typename Vec::value_type, E>)
auto aie::min ( const Vec &  v,
a,
bool  sign 
) -> aie_dm_resource_remove_t<Vec>

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
vInput vector. The type must meet aie::RealVector.
aValue. The type must meet aie::RealElem.
signWhether the inputs need to be interpreted as signed values.

◆ min() [3/6]

template<RealVector Vec1, RealVector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
auto aie::min ( const Vec1 &  v1,
const Vec2 &  v2 
) -> aie_dm_resource_remove_t<Vec1>

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
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.

◆ min() [4/6]

template<RealVector Vec1, RealVector Vec2>
requires (arch::is(arch::AIE_ML) && is_same_vector_v<Vec1, Vec2>)
auto aie::min ( const Vec1 &  v1,
const Vec2 &  v2,
bool  sign 
) -> aie_dm_resource_remove_t<Vec1>

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
v1First input vector. The type must meet aie::RealVector.
v2Second input vector. The type must meet aie::RealVector.
signWhether the inputs need to be interpreted as signed values.

◆ min() [5/6]

template<RealElem E, RealVector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::min ( a,
const Vec &  v 
) -> aie_dm_resource_remove_t<Vec>

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
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.

◆ min() [6/6]

template<RealElem E, RealVector Vec>
requires (arch::is(arch::AIE_ML) && is_valid_elem_op_v<E, typename Vec::value_type>)
auto aie::min ( a,
const Vec &  v,
bool  sign 
) -> aie_dm_resource_remove_t<Vec>

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
aValue. The type must meet aie::RealElem.
vInput vector. The type must meet aie::RealVector.
signWhether the inputs need to be interpreted as signed values.

◆ neq() [1/3]

template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::neq ( const Vec &  v,
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 (unsigned i = 0; i < Elems; ++i)
out[i] = v[i] != a;
Parameters
vInput vector. The type must meet aie::Vector.
aValue. The type must meet aie::Elem.

◆ neq() [2/3]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
mask< Vec1::size()> 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 (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] != v2[i];
Parameters
v1First input vector. The type must meet aie::Vector.
v2Second input vector. The type must meet aie::Vector.

◆ neq() [3/3]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
mask< Vec::size()> aie::neq ( 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 (unsigned i = 0; i < Elems; ++i)
out[i] = a != v[i];
Parameters
aValue. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.

◆ not_equal() [1/3]

template<Vector Vec, Elem E>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::not_equal ( const Vec &  v,
a 
)
constexpr

Return whether some the elements of the input vector are not equal to the scalar.

bool out = true;
for (unsigned i = 0; i < Elems; ++i)
out = out && (v[i] != a);
Parameters
vInput vector. The type must meet aie::Vector.
aInput scalar. The type must meet aie::Elem.

◆ not_equal() [2/3]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2>)
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.

bool out = true;
for (unsigned i = 0; i < Elems; ++i)
out = out && (v1[i] != v2[i]);
Parameters
v1First input vector. The type must meet aie::Vector.
v2Second input vector. The type must meet aie::Vector.

◆ not_equal() [3/3]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type>)
constexpr bool aie::not_equal ( a,
const Vec &  v 
)
constexpr

Return whether some the elements of the input vector are not equal to the scalar.

bool out = true;
for (unsigned i = 0; i < Elems; ++i)
out = out && (a != v[i]);
Parameters
aInput scalar. The type must meet aie::Elem.
vInput vector. The type must meet aie::Vector.