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

One vector (or, for interleaved views, one group of Stride vectors) of a range, and how many of its leading lanes lie inside the range. More...

#include <tail.hpp>

Public Types

using argon_type = Argon<ScalarType>
 The type of one vector.
using vector_type = std::conditional_t<Stride == 1, argon_type, std::array<argon_type, Stride>>
 The value: a vector, or for interleaved views an array of one vector per channel.
using predicate_type = typename argon_type::argon_bool_type
 The predicate type for active().

Public Member Functions

 Partial (vector_type value, size_t remaining)
 A value whose first remaining lanes are in the range (lanes or more means all of them).
vector_type & operator* ()
 The value. Lanes past the end of the range are zero after a load.
const vector_type & operator* () const
 The value. Lanes past the end of the range are zero after a load.
vector_type * operator-> ()
 Member access on the value.
const vector_type * operator-> () const
 Member access on the value.
Partial & operator= (vector_type value)
 Replace the value; only the lanes inside the range are stored.
size_t count () const
 The number of leading lanes inside the range.
bool full () const
 Whether every lane is inside the range.
predicate_type active () const
 The lanes inside the range, as a predicate.
size_t remaining () const
 The lanes left in the range from this vector on; FirstN of it is active().

Static Public Attributes

static constexpr size_t lanes = argon_type::lanes
 The number of lanes in each vector.

Detailed Description

template<typename ScalarType, size_t Stride = 1>
class argon::vectorize::Partial< ScalarType, Stride >

One vector (or, for interleaved views, one group of Stride vectors) of a range, and how many of its leading lanes lie inside the range.

Template Parameters
ScalarTypeThe element type of the range.
StrideThe interleave stride: 1 for a plain view, 2 to 4 for an interleaved one, whose lanes are frames of Stride consecutive elements.

Every vector of a with_tail() view is full except possibly the last. Lanes past the end of the range are zero when loaded and are never written when stored; use active() to keep them out of reductions such as minimum or maximum, where a zero would matter.

Member Function Documentation

◆ operator*()

template<typename ScalarType, size_t Stride = 1>
const vector_type & argon::vectorize::Partial< ScalarType, Stride >::operator* ( ) const
inline

The value. Lanes past the end of the range are zero after a load.

◆ operator->()

template<typename ScalarType, size_t Stride = 1>
const vector_type * argon::vectorize::Partial< ScalarType, Stride >::operator-> ( ) const
inline

Member access on the value.


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