E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ has_equal_in

callable_has_equal_in_ eve::has_equal_in = {}
inlineconstexpr

Optional last parameter allows to ovewrite the equality from eve::is_equal to an arbitrary simd binary predicate.

We took the idea for the operation from: "Faster-Than-Native Alternatives for x86 VP2INTERSECT Instructions" by Guillermo Diez-Canas. Link: https://arxiv.org/abs/2112.06342

Parameters

Return value

logical built as described previously

Example

#include <iostream>
#include <eve/module/core.hpp>
int main()
{
wide_it x = {2, 1, 2, 4};
wide_it y = {0, 2, 3, 1};
std::cout << "---- simd" << '\n'
<< "<- x = " << x << '\n'
<< "<- y = " << y << '\n'
<< "-> has_equal_in(x, y) = " << eve::has_equal_in(x, y) << '\n'
<< "-> has_equal_in(y, x) = " << eve::has_equal_in(y, x) << '\n';
}
constexpr callable_has_equal_in_ has_equal_in
Given two simd_values: x, match_against returns a logical mask. The res[i] == eve::any(x[i] == match_...
Definition has_equal_in.hpp:45
Wrapper for SIMD registers.
Definition wide.hpp:70