Loading...
Searching...
No Matches
interface.hh File Reference
Common » Vectorization » Library Developer's Interface

User interface of the SIMD abstraction. More...

`#include <cassert>`
`#include <cstddef>`
`#include <type_traits>`
`#include <utility>`
`#include <dune/common/simd/base.hh>`
`#include <dune/common/typelist.hh>`

Go to the source code of this file.

## Namespaces

namespace | Dune
| Dune namespace
namespace | Dune::Simd
| Namespace for vectorization interface functions used by library developers.

## Basic interface

template<class V>
using | Dune::Simd::Scalar = typename Overloads::ScalarType<std::decay_t<V> >::type
| Element type of some SIMD type.
template<class S, class V>
using | Dune::Simd::Rebind
| Construct SIMD type with different scalar type.
template<class V>
constexpr std::size_t | Dune::Simd::lanes ()
| Number of lanes in a SIMD type.
template<class V>
decltype(auto) | Dune::Simd::lane (std::size_t l, V &&v)
| Extract an element of a SIMD type.
template<class V, class U>
constexpr V | Dune::Simd::implCast (U &&u)
| Cast an expression from one implementation to another.
template<class V, class S>
constexpr V | Dune::Simd::broadcast (S s)
| Broadcast a scalar to a vector explicitly.
template<class M, class V>
V | Dune::Simd::cond (M &&mask, const V &ifTrue, const V &ifFalse)
| Like the ?: operator.
template<class V>
V | Dune::Simd::cond (bool mask, const V &ifTrue, const V &ifFalse)
| Like the ?: operator.
template<class V>
auto | Dune::Simd::max (const V &v1, const V &v2)
| The binary maximum value over two simd objects.
template<class V>
auto | Dune::Simd::min (const V &v1, const V &v2)
| The binary minimum value over two simd objects.
template<class Mask>
bool | Dune::Simd::anyTrue (const Mask &mask)
| Whether any entry is true.
template<class Mask>
bool | Dune::Simd::allTrue (const Mask &mask)
| Whether all entries are true.
template<class Mask>
bool | Dune::Simd::anyFalse (const Mask &mask)
| Whether any entry is false.
template<class Mask>
bool | Dune::Simd::allFalse (const Mask &mask)
| Whether all entries are false.
template<class V>
Scalar< V > | Dune::Simd::max (const V &v)
| The horizontal maximum value over all lanes.
template<class V>
Scalar< V > | Dune::Simd::min (const V &v)
| The horizontal minimum value over all lanes.
template<class V>
auto | Dune::Simd::mask (const V &v)
| Convert to mask, analogue of bool(s) for scalars.
template<class V1, class V2>
auto | Dune::Simd::maskOr (const V1 &v1, const V2 &v2)
| Logic or of masks.
template<class V1, class V2>
auto | Dune::Simd::maskAnd (const V1 &v1, const V2 &v2)
| Logic and of masks.

## Syntactic Sugar

Templates and functions in this group provide syntactic sugar, they are implemented using the functionality from SimdInterfaceBase, and are not customizable by implementations.
template<class V>
using | Dune::Simd::Mask = Rebind<bool, V>
| Mask type type of some SIMD type.
template<class V>
std::size_t | Dune::Simd::lanes (const V &)
| Number of lanes in a SIMD type.

## Detailed Description

User interface of the SIMD abstraction.

This file provides the user interface functions of the SIMD abstraction layer.

This file should never be included by users of the SIMD abstraction. Include <dune/common/simd/simd.hh> instead.