Argon 0.1.0
Loading...
Searching...
No Matches
argon::vectorize::Step< ScalarType, full > Class Template Reference

One step of vectorize::for_each: the elements [index(), index() + count()) of the range. More...

#include <for_each.hpp>

Public Types

using argon_type = Argon<ScalarType>
 The vector type of the loop.
using predicate_type = typename argon_type::argon_bool_type
 The predicate type of active().

Public Member Functions

 Step (std::ptrdiff_t index, std::ptrdiff_t remaining)
std::ptrdiff_t index () const
 The index of this step's first element.
std::ptrdiff_t count () const
 The number of this step's lanes inside the range.
predicate_type active () const
 The lanes inside the range.
argon_type Load (const ScalarType *base) const
 Load this step's elements of the array at base; out-of-range lanes are zero and not read.
void Store (ScalarType *base, argon_type value) const
 Store value to this step's elements of the array at base; out-of-range lanes are not written.
template<typename N>
argon_type LoadWiden (const N *base) const
 Load this step's elements of an array of the narrower integer type N, extending them to lanes.
template<typename N>
void StoreNarrow (N *base, argon_type value) const
 Store the low bits of value to this step's elements of an array of the narrower integer type N.

Static Public Attributes

static constexpr std::ptrdiff_t lanes = argon_type::lanes
 Elements per step.

Detailed Description

template<typename ScalarType, bool full>
class argon::vectorize::Step< ScalarType, full >

One step of vectorize::for_each: the elements [index(), index() + count()) of the range.

Template Parameters
ScalarTypeThe lane type the loop is written in.
fullWhether every lane is in range. On NEON the loop body is instantiated with full steps for the whole vectors (plain loads and stores) and once more with a partial step for the tail, whose accesses branch on its scalar count rather than a predicate (see first_n.hpp); on MVE every step is predicated, which is what lets the compiler drop the predication into the loop instructions (dlstp/letp).

Member Function Documentation

◆ active()

template<typename ScalarType, bool full>
predicate_type argon::vectorize::Step< ScalarType, full >::active ( ) const
inline

The lanes inside the range.

Out-of-range lanes load as zero, so use this to keep them out of reductions such as a minimum.


The documentation for this class was generated from the following file: