Sorting algorithm, based on sortin networks.
Also our implementation is not directly based on any specific one, people we are definetly not the first people to do this. Here is a list of previous work that was looked at.
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
auto myless = [](auto z1, auto z2){ return z1 > z2; };
eve::wide wf0{0.0, 1.0, 2.0, 3.0, -1.0, -2.0, -3.0, -4.0};
eve::wide wu0{0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "<- wi0 = " << wi0 << "\n";
std::cout << "<- wu0 = " << wu0 << "\n";
std::cout <<
"-> sort(wf0) = " <<
eve::sort(wf0) <<
"\n";
std::cout <<
"-> sort(wf0, myless) = " <<
eve::sort(wf0, myless) <<
"\n";
std::cout <<
"-> sort(wu0) = " <<
eve::sort(wu0) <<
"\n";
std::cout <<
"-> sort(wu0, myless) = " <<
eve::sort(wu0, myless) <<
"\n";
std::cout <<
"-> sort(wi0) = " <<
eve::sort(wi0) <<
"\n";
std::cout <<
"-> sort(wi0, myless) = " <<
eve::sort(wi0, myless) <<
"\n";
}
Wrapper for SIMD registers.
Definition wide.hpp:70