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_cardinal = ::rbr::flag( divisible_by_cardinal_tag{} )

Variable Documentation

◆ divisible_by_cardinal

auto eve::algo::divisible_by_cardinal = ::rbr::flag( divisible_by_cardinal_tag{} )
inlineconstexpr
Header file #include <eve/module/algo.hpp>
namespace eve::algo
{
inline constexpr auto divisible_by_cardinal = eve_implementation_defined;
}
constexpr auto divisible_by_cardinal
Definition traits.hpp:428

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.

A range whose two ends are aligned pointers with an alignment at least the cardinal carries this trait already, deduced.

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:465
constexpr auto find_if
SIMD version of std::find_if.
Definition find.hpp:130
See also
no_aligning