Loading...
Searching...
No Matches
Dune::Simd::Overloads Namespace Reference
Common » Vectorization » Abstraction Developer's Interface

Namespace for the overloads and specializations that make up a SIMD implementation. More...

## Classes

struct | ScalarType< AlignedNumber< T, align > >
struct | RebindType< U, AlignedNumber< T, align > >
struct | LaneCount< AlignedNumber< T, align > >
struct | ADLTag
| Tag used to force late-binding lookup in Dune::Simd::Overloads. More...
struct | ADLTag< i >
struct | ADLTag< 0 >
struct | ScalarType
| should have a member type `type` More...
struct | RebindType
| should have a member type `type` More...
struct | LaneCount
| should be derived from a Dune::index_constant More...
struct | ScalarType< LoopSIMD< T, S, A > >
struct | RebindType< U, LoopSIMD< T, S, A > >
struct | LaneCount< LoopSIMD< T, S, A > >
struct | ScalarType< V, std::enable_if_t< VcImpl::IsVector< V >::value > >
| should have a member type `type` More...
struct | RebindType< Simd::Scalar< V >, V, std::enable_if_t< VcImpl::IsVector< V >::value > >
| should have a member type `type` More...
struct | RebindType< bool, V, std::enable_if_t< VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value > >
| should have a member type `type` More...
struct | RebindType< Scalar< typename M::Vector >, M, std::enable_if_t< VcImpl::IsMask< M >::value > >
| should have a member type `type` More...
struct | RebindType< S, M, std::enable_if_t< VcImpl::IsMask< M >::value &&VcImpl::IsVectorizable< S >::value &&!std::is_same< S, Scalar< typename M::Vector > >::value > >
| should have a member type `type` More...
struct | RebindType< S, V, std::enable_if_t< VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value &&VcImpl::IsVectorizable< S >::value &&!std::is_same< S, Scalar< V > >::value > >
| should have a member type `type` More...
struct | RebindType< S, V, std::enable_if_t< VcImpl::IsVector< V >::value &&!VcImpl::IsVectorizable< S >::value &&!std::is_same< S, bool >::value &&!std::is_same< S, Scalar< V > >::value > >
| should have a member type `type` More...
struct | LaneCount< V, std::enable_if_t< VcImpl::IsVector< V >::value > >
| should be derived from an Dune::index_constant More...

## Functions

template<class T, std::size_t align>
T & | lane (ADLTag< 5 >, std::size_t l, AlignedNumber< T, align > &v)
template<class T, std::size_t align>
T | lane (ADLTag< 5 >, std::size_t l, const AlignedNumber< T, align > &v)
template<class T, std::size_t align>
const AlignedNumber< T, align > & | cond (ADLTag< 5 >, AlignedNumber< bool, align > mask, const AlignedNumber< T, align > &ifTrue, const AlignedNumber< T, align > &ifFalse)
template<std::size_t align>
bool | anyTrue (ADLTag< 5 >, const AlignedNumber< bool, align > &mask)
template<class T, std::size_t S, std::size_t A>
auto | lane (ADLTag< 5 >, std::size_t l, LoopSIMD< T, S, A > &&v) -> decltype(std::move(Simd::lane(l%lanes< T >(), v[l/lanes< T >()])))
template<class T, std::size_t S, std::size_t A>
auto | lane (ADLTag< 5 >, std::size_t l, const LoopSIMD< T, S, A > &v) -> decltype(Simd::lane(l%lanes< T >(), v[l/lanes< T >()]))
template<class T, std::size_t S, std::size_t A>
auto | lane (ADLTag< 5 >, std::size_t l, LoopSIMD< T, S, A > &v) -> decltype(Simd::lane(l%lanes< T >(), v[l/lanes< T >()]))
template<class T, std::size_t S, std::size_t AM, std::size_t AD>
auto | cond (ADLTag< 5 >, const Simd::Mask< LoopSIMD< T, S, AM > > &mask, const LoopSIMD< T, S, AD > &ifTrue, const LoopSIMD< T, S, AD > &ifFalse)
template<class M, class T, std::size_t S, std::size_t A>
auto | cond (ADLTag< 5, std::is_same< bool, Simd::Scalar< M > >::value &&Simd::lanes< M >()==Simd::lanes< LoopSIMD< T, S, A > >()>, const M &mask, const LoopSIMD< T, S, A > &ifTrue, const LoopSIMD< T, S, A > &ifFalse)
template<class M, std::size_t S, std::size_t A>
bool | anyTrue (ADLTag< 5 >, const LoopSIMD< M, S, A > &mask)
template<class M, std::size_t S, std::size_t A>
bool | allTrue (ADLTag< 5 >, const LoopSIMD< M, S, A > &mask)
template<class M, std::size_t S, std::size_t A>
bool | anyFalse (ADLTag< 5 >, const LoopSIMD< M, S, A > &mask)
template<class M, std::size_t S, std::size_t A>
bool | allFalse (ADLTag< 5 >, const LoopSIMD< M, S, A > &mask)
Overloadable and default functions
This group contains functions that you, as an abstraction developer, must implement. All functions that are deleted must be provided, functions that have a default implementation may be left unimplemented if the default behaviour is satisfactory.
template<class V>
decltype(auto) | lane (ADLTag< 0 >, std::size_t l, V v)=delete
| implements Simd::lane()
template<class V>
constexpr V | implCast (ADLTag< 0 >, MetaType< V >, const V &u)
| implements Simd::implCast<V>(V)
template<class V, class U>
constexpr V | implCast (ADLTag< 0 >, MetaType< V >, const U &u)
| implements Simd::implCast<V>(U)
template<class V, class S>
auto | broadcast (ADLTag< 0 >, MetaType< V >, S s)
| implements Simd::broadcast<V>()
template<class V>
V | cond (ADLTag< 0 >, const Mask< V > &mask, const V &ifTrue, const V &ifFalse)=delete
| implements Simd::cond()
template<class V>
auto | max (ADLTag< 0 >, const V &v1, const V &v2)
| implements binary Simd::max()
template<class V>
auto | min (ADLTag< 0 >, const V &v1, const V &v2)
| implements binary Simd::min()
template<class Mask>
bool | anyTrue (ADLTag< 0 >, const Mask &mask)=delete
| implements Simd::anyTrue()
template<class Mask>
bool | allTrue (ADLTag< 0 >, const Mask &mask)
| implements Simd::allTrue()
template<class Mask>
bool | anyFalse (ADLTag< 0 >, const Mask &mask)
| implements Simd::anyFalse()
template<class Mask>
bool | allFalse (ADLTag< 0 >, const Mask &mask)
| implements Simd::allFalse()
template<class V>
auto | max (ADLTag< 0 >, const V &v)
| implements Simd::maxValue()
template<class V>
auto | min (ADLTag< 0 >, const V &v)
| implements Simd::minValue()
template<class V>
Mask< V > | mask (ADLTag< 0, std::is_same< V, Mask< V > >::value >, const V &v)
| implements Simd::mask()
template<class V>
auto | mask (ADLTag< 0, !std::is_same< V, Mask< V > >::value >, const V &v)
| implements Simd::mask()
template<class V1, class V2>
auto | maskOr (ADLTag< 0 >, const V1 &v1, const V2 &v2)
| implements Simd::maskOr()
template<class V1, class V2>
auto | maskAnd (ADLTag< 0 >, const V1 &v1, const V2 &v2)
| implements Simd::maskAnd()
Specialized classes and overloaded functions
template<class V>
V | lane (ADLTag< 2 >, std::size_t, V v)
| implements Simd::lane()
template<class V>
V & | lane (ADLTag< 3 >, std::size_t, V &v)
bool | anyTrue (ADLTag< 2 >, bool mask)
| implements Simd::anyTrue()
bool | allTrue (ADLTag< 2 >, bool mask)
| implements Simd::allTrue()
bool | anyFalse (ADLTag< 2 >, bool mask)
| implements Simd::anyFalse()
bool | allFalse (ADLTag< 2 >, bool mask)
| implements Simd::allFalse()
template<class V>
VcImpl::Proxy< V > | lane (ADLTag< 5, VcImpl::IsVector< V >::value >, std::size_t l, V &v)
| implements Simd::lane()
template<class V>
Scalar< V > | lane (ADLTag< 5, VcImpl::IsVector< V >::value >, std::size_t l, const V &v)
| implements Simd::lane()
template<class V, class = std::enable_if_t<!std::is_reference<V>::value>>
Scalar< V > | lane (ADLTag< 5, VcImpl::IsVector< V >::value >, std::size_t l, V &&v)
| implements Simd::lane()
template<class V>
V | cond (ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value >, const Mask< V > &mask, const V &ifTrue, const V &ifFalse)
| implements Simd::cond()
template<class V>
V | cond (ADLTag< 5, VcImpl::IsMask< V >::value >, const V &mask, const V &ifTrue, const V &ifFalse)
| implements Simd::cond()
template<class V>
auto | max (ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value >, const V &v1, const V &v2)
| implements binary Simd::max()
template<class M>
auto | max (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &m1, const M &m2)
| implements binary Simd::max()
template<class V>
auto | min (ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value >, const V &v1, const V &v2)
| implements binary Simd::min()
template<class M>
auto | min (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &m1, const M &m2)
| implements binary Simd::min()
template<class M>
bool | anyTrue (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &mask)
| implements Simd::anyTrue()
template<class M>
bool | allTrue (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &mask)
| implements Simd::allTrue()
template<class M>
bool | allFalse (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &mask)
| implements Simd::allFalse()
template<class V>
auto | max (ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value >, const V &v)
| implements Simd::maxValue()
template<class M>
bool | max (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &mask)
| implements Simd::maxValue()
template<class V>
auto | min (ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value >, const V &v)
| implements Simd::minValue()
template<class M>
bool | min (ADLTag< 5, VcImpl::IsMask< M >::value >, const M &mask)
| implements Simd::minValue()
template<class S1, class V2>
auto | maskAnd (ADLTag< 5, std::is_same< Mask< S1 >, bool >::value &&VcImpl::IsVector< V2 >::value >, const S1 &s1, const V2 &v2)
| implements Simd::maskAnd()
template<class V1, class S2>
auto | maskAnd (ADLTag< 5, VcImpl::IsVector< V1 >::value &&std::is_same< Mask< S2 >, bool >::value >, const V1 &v1, const S2 &s2)
| implements Simd::maskAnd()
template<class S1, class V2>
auto | maskOr (ADLTag< 5, std::is_same< Mask< S1 >, bool >::value &&VcImpl::IsVector< V2 >::value >, const S1 &s1, const V2 &v2)
| implements Simd::maskOr()
template<class V1, class S2>
auto | maskOr (ADLTag< 5, VcImpl::IsVector< V1 >::value &&std::is_same< Mask< S2 >, bool >::value >, const V1 &v1, const S2 &s2)
| implements Simd::maskOr()

## Detailed Description

Namespace for the overloads and specializations that make up a SIMD implementation.

This namespace contains three sets of things: the struct ADLTag, which is used to look up functions in this namespace using argument-dependet lookup, traits classes that must be specialized by abstraction implementations, and functions that must/can be overloaded by abstraction implementations.

Note
  Only introduce new names into this namespace to extend the interface. This applies in particular to people in the "abstraction developer" role; they may meddle in this namespace only by providing overloads and/or specializations for existing names (and for ADLTag even that is prohibited).

## Function Documentation

## allFalse() [1/3]

bool Dune::Simd::Overloads::allFalse | ( | ADLTag< 2 > | ,
|  | bool | mask )

inline

implements Simd::allFalse()

## allFalse() [2/3]

template<class M, std::size_t S, std::size_t A>

bool Dune::Simd::Overloads::allFalse | ( | ADLTag< 5 > | ,
|  | const LoopSIMD< M, S, A > & | mask )

## allFalse() [3/3]

template<class M>

bool Dune::Simd::Overloads::allFalse | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | mask )

implements Simd::allFalse()

## allTrue() [1/3]

bool Dune::Simd::Overloads::allTrue | ( | ADLTag< 2 > | ,
|  | bool | mask )

inline

implements Simd::allTrue()

## allTrue() [2/3]

template<class M, std::size_t S, std::size_t A>

bool Dune::Simd::Overloads::allTrue | ( | ADLTag< 5 > | ,
|  | const LoopSIMD< M, S, A > & | mask )

## allTrue() [3/3]

template<class M>

bool Dune::Simd::Overloads::allTrue | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | mask )

implements Simd::allTrue()

## anyFalse() [1/2]

bool Dune::Simd::Overloads::anyFalse | ( | ADLTag< 2 > | ,
|  | bool | mask )

inline

implements Simd::anyFalse()

## anyFalse() [2/2]

template<class M, std::size_t S, std::size_t A>

bool Dune::Simd::Overloads::anyFalse | ( | ADLTag< 5 > | ,
|  | const LoopSIMD< M, S, A > & | mask )

## anyTrue() [1/4]

bool Dune::Simd::Overloads::anyTrue | ( | ADLTag< 2 > | ,
|  | bool | mask )

inline

implements Simd::anyTrue()

## anyTrue() [2/4]

template<std::size_t align>

bool Dune::Simd::Overloads::anyTrue | ( | ADLTag< 5 > | ,
|  | const AlignedNumber< bool, align > & | mask )

## anyTrue() [3/4]

template<class M, std::size_t S, std::size_t A>

bool Dune::Simd::Overloads::anyTrue | ( | ADLTag< 5 > | ,
|  | const LoopSIMD< M, S, A > & | mask )

## anyTrue() [4/4]

template<class M>

bool Dune::Simd::Overloads::anyTrue | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | mask )

implements Simd::anyTrue()

## cond() [1/5]

template<class T, std::size_t align>

const AlignedNumber< T, align > & Dune::Simd::Overloads::cond | ( | ADLTag< 5 > | ,
|  | AlignedNumber< bool, align > | mask,
|  | const AlignedNumber< T, align > & | ifTrue,
|  | const AlignedNumber< T, align > & | ifFalse )

## cond() [2/5]

template<class T, std::size_t S, std::size_t AM, std::size_t AD>

auto Dune::Simd::Overloads::cond | ( | ADLTag< 5 > | ,
|  | const Simd::Mask< LoopSIMD< T, S, AM > > & | mask,
|  | const LoopSIMD< T, S, AD > & | ifTrue,
|  | const LoopSIMD< T, S, AD > & | ifFalse )

## cond() [3/5]

template<class M, class T, std::size_t S, std::size_t A>

auto Dune::Simd::Overloads::cond | ( | ADLTag< 5, std::is_same< bool, Simd::Scalar< M > >::value &&Simd::lanes< M >()==Simd::lanes< LoopSIMD< T, S, A > >()> | ,
|  | const M & | mask,
|  | const LoopSIMD< T, S, A > & | ifTrue,
|  | const LoopSIMD< T, S, A > & | ifFalse )

## cond() [4/5]

template<class V>

V Dune::Simd::Overloads::cond | ( | ADLTag< 5, VcImpl::IsMask< V >::value > | ,
|  | const V & | mask,
|  | const V & | ifTrue,
|  | const V & | ifFalse )

implements Simd::cond()

## cond() [5/5]

template<class V>

V Dune::Simd::Overloads::cond | ( | ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value > | ,
|  | const Mask< V > & | mask,
|  | const V & | ifTrue,
|  | const V & | ifFalse )

implements Simd::cond()

## lane() [1/10]

template<class V>

V Dune::Simd::Overloads::lane | ( | ADLTag< 2 > | ,
|  | std::size_t | ,
|  | V | v )

implements Simd::lane()

This binds to rvalues and const lvalues. It would bind to non-const lvalues too, but those are caught by the overload with ADLTag<3>. Using a universal reference here would bind to any argument with a perfect match. This would mean ambiguous overloads with other abstractions, if those only declare overloads for const TheirType & and TheirType &, because because universal references match perfectly.

## lane() [2/10]

template<class V>

V & Dune::Simd::Overloads::lane | ( | ADLTag< 3 > | ,
|  | std::size_t | ,
|  | V & | v )

## lane() [3/10]

template<class T, std::size_t align>

T & Dune::Simd::Overloads::lane | ( | ADLTag< 5 > | ,
|  | std::size_t | l,
|  | AlignedNumber< T, align > & | v )

## lane() [4/10]

template<class T, std::size_t align>

T Dune::Simd::Overloads::lane | ( | ADLTag< 5 > | ,
|  | std::size_t | l,
|  | const AlignedNumber< T, align > & | v )

## lane() [5/10]

template<class T, std::size_t S, std::size_t A>

auto Dune::Simd::Overloads::lane | ( | ADLTag< 5 > | ,
|  | std::size_t | l,
|  | const LoopSIMD< T, S, A > & | v )->decltype(Simd::lane(l%lanes< T >(), v[l/lanes< T >()]))

## lane() [6/10]

template<class T, std::size_t S, std::size_t A>

auto Dune::Simd::Overloads::lane | ( | ADLTag< 5 > | ,
|  | std::size_t | l,
|  | LoopSIMD< T, S, A > && | v )->decltype(std::move(Simd::lane(l%lanes< T >(), v[l/lanes< T >()])))

## lane() [7/10]

template<class T, std::size_t S, std::size_t A>

auto Dune::Simd::Overloads::lane | ( | ADLTag< 5 > | ,
|  | std::size_t | l,
|  | LoopSIMD< T, S, A > & | v )->decltype(Simd::lane(l%lanes< T >(), v[l/lanes< T >()]))

## lane() [8/10]

template<class V>

Scalar< V > Dune::Simd::Overloads::lane | ( | ADLTag< 5, VcImpl::IsVector< V >::value > | ,
|  | std::size_t | l,
|  | const V & | v )

implements Simd::lane()

## lane() [9/10]

template<class V, class = std::enable_if_t<!std::is_reference<V>::value>>

Scalar< V > Dune::Simd::Overloads::lane | ( | ADLTag< 5, VcImpl::IsVector< V >::value > | ,
|  | std::size_t | l,
|  | V && | v )

implements Simd::lane()

## lane() [10/10]

template<class V>

VcImpl::Proxy< V > Dune::Simd::Overloads::lane | ( | ADLTag< 5, VcImpl::IsVector< V >::value > | ,
|  | std::size_t | l,
|  | V & | v )

implements Simd::lane()

## maskAnd() [1/2]

template<class S1, class V2>

auto Dune::Simd::Overloads::maskAnd | ( | ADLTag< 5, std::is_same< Mask< S1 >, bool >::value &&VcImpl::IsVector< V2 >::value > | ,
|  | const S1 & | s1,
|  | const V2 & | v2 )

implements Simd::maskAnd()

## maskAnd() [2/2]

template<class V1, class S2>

auto Dune::Simd::Overloads::maskAnd | ( | ADLTag< 5, VcImpl::IsVector< V1 >::value &&std::is_same< Mask< S2 >, bool >::value > | ,
|  | const V1 & | v1,
|  | const S2 & | s2 )

implements Simd::maskAnd()

## maskOr() [1/2]

template<class S1, class V2>

auto Dune::Simd::Overloads::maskOr | ( | ADLTag< 5, std::is_same< Mask< S1 >, bool >::value &&VcImpl::IsVector< V2 >::value > | ,
|  | const S1 & | s1,
|  | const V2 & | v2 )

implements Simd::maskOr()

## maskOr() [2/2]

template<class V1, class S2>

auto Dune::Simd::Overloads::maskOr | ( | ADLTag< 5, VcImpl::IsVector< V1 >::value &&std::is_same< Mask< S2 >, bool >::value > | ,
|  | const V1 & | v1,
|  | const S2 & | s2 )

implements Simd::maskOr()

## max() [1/4]

template<class M>

auto Dune::Simd::Overloads::max | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | m1,
|  | const M & | m2 )

implements binary Simd::max()

## max() [2/4]

template<class M>

bool Dune::Simd::Overloads::max | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | mask )

implements Simd::maxValue()

## max() [3/4]

template<class V>

auto Dune::Simd::Overloads::max | ( | ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value > | ,
|  | const V & | v )

implements Simd::maxValue()

## max() [4/4]

template<class V>

auto Dune::Simd::Overloads::max | ( | ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value > | ,
|  | const V & | v1,
|  | const V & | v2 )

implements binary Simd::max()

## min() [1/4]

template<class M>

auto Dune::Simd::Overloads::min | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | m1,
|  | const M & | m2 )

implements binary Simd::min()

## min() [2/4]

template<class M>

bool Dune::Simd::Overloads::min | ( | ADLTag< 5, VcImpl::IsMask< M >::value > | ,
|  | const M & | mask )

implements Simd::minValue()

## min() [3/4]

template<class V>

auto Dune::Simd::Overloads::min | ( | ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value > | ,
|  | const V & | v )

implements Simd::minValue()

## min() [4/4]

template<class V>

auto Dune::Simd::Overloads::min | ( | ADLTag< 5, VcImpl::IsVector< V >::value &&!VcImpl::IsMask< V >::value > | ,
|  | const V & | v1,
|  | const V & | v2 )

implements binary Simd::min()