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

Detailed Description

States that a range holds a whole number of SIMD registers.

Variables

constexpr auto eve::algo::divisible_by_width = ::rbr::flag( divisible_by_width_tag{} )
 an trait to tell that the input data is strictly divisible by width.

Variable Documentation

◆ divisible_by_width

auto eve::algo::divisible_by_width = ::rbr::flag( divisible_by_width_tag{} )
inlineconstexpr

an trait to tell that the input data is strictly divisible by width.

namespace eve::algo
{
inline constexpr auto divisible_by_cardinal = eve_implementation_defined;
}

States that the range holds a whole number of SIMD registers, so the loop needs no tail handling. Alignment takes precedence: a loop that aligns its accesses reads a partial first register, and the tail handling returns. The trait therefore takes effect on an unaligned pointer, or with eve::algo::no_aligning.

Note
this trait is deduced automatically if both begin and end of the range are aligned_ptr with alignment >= width. If you are using this, consider aligning your data too.
std::vector<float> data(1024);
auto positive = [](auto x) { return x > 0.f; };
// 1024 is a multiple of every cardinal: no tail, the accesses left unaligned.
auto found = find_if[divisible_by_cardinal][no_aligning](data, positive);
constexpr auto no_aligning
Definition traits.hpp:455
constexpr auto find_if
SIMD version of std::find_if.
Definition find.hpp:130
See also
no_aligning