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

Detailed Description

Optimises a filtering algorithm for most elements kept per step.

Variables

constexpr auto eve::algo::dense_output = (density_key = eve::dense)

Variable Documentation

◆ dense_output

auto eve::algo::dense_output = (density_key = eve::dense)
inlineconstexpr
Header file #include <eve/module/algo.hpp>
namespace eve::algo
{
inline constexpr auto dense_output = eve_implementation_defined;
}
constexpr auto dense_output
Definition traits.hpp:867

Shapes a filtering algorithm for a step that keeps most of its lanes, which is the default. eve::algo::copy_if, eve::algo::remove_if and eve::algo::set_intersection write what they keep, and their loop has one shape per expected density; this one measures better in most cases, and eve::algo::sparse_output suits a step that keeps a handful of lanes.

std::vector<int> in(1024), out(1024);
// Almost every element passes: the default shape, named to make the choice explicit.
auto end = copy_if[dense_output](in, out, [](auto x) { return x != 0; });
constexpr auto copy_if
SIMD variation on std::copy_if.
Definition copy_if.hpp:149
See also
sparse_output