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

◆ try_each_group_position

callable_try_each_group_position_ eve::try_each_group_position = {}
inlineconstexpr

This is useful when one needs to try each element against something. Motivational example could be intersection: try each element from one register against another. Groups allow you to treat N elements as one.

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

  • x : argument.
  • fixed<N> : number of elements in group

Return value

kumi::tuple of all results

Example

#include <iostream>
#include <eve/module/core.hpp>
int main()
{
wide_it x = {1, 2, 3, 4};
std::cout << "---- simd" << '\n'
<< "<- x = " << x << '\n'
<< "-> try_each_group_position(x, eve::lane<1>) = " << eve::try_each_group_position(x, eve::lane<1>) << '\n'
<< "-> try_each_group_position(x, eve::lane<2>) = " << eve::try_each_group_position(x, eve::lane<2>) << '\n';
}
constexpr callable_try_each_group_position_ try_each_group_position
For a given simd_value and a group size returns a tuple of (x::size() / group_size) permuatitions for...
Definition try_each_group_position.hpp:51
Wrapper for SIMD registers.
Definition wide.hpp:70