Loading...
Searching...
No Matches
standard.hh
Go to the documentation of this file.
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_COMMON_SIMD_STANDARD_HH
#define DUNE_COMMON_SIMD_STANDARD_HH
#include <cstddef>
#include <type_traits>
#include <utility>
#include <dune/common/indices.hh>
#include <dune/common/simd/base.hh>
#include <dune/common/simd/defaults.hh>
namespace Dune {
namespace Simd {
namespace Overloads {
template<class V, class>
struct ScalarType { using type = V; };
template<class S, class, class>
struct RebindType { using type = S; };
template<class, class>
struct LaneCount : public index_constant<1> { };
template<class V>
V lane(ADLTag<2>, std::size_t, V v)
{
return v;
}
template<class V>
V &lane(ADLTag<3>, std::size_t, V &v)
{
return v;
}
// No Simd::cond() implementation, the overload for bool masks in the
// interface is sufficient
inline bool anyTrue(ADLTag<2>, bool mask) { return mask; }
inline bool allTrue(ADLTag<2>, bool mask) { return mask; }
inline bool anyFalse(ADLTag<2>, bool mask) { return !mask; }
inline bool allFalse(ADLTag<2>, bool mask) { return !mask; }
} // namespace Overloads
} // namespace Simd
} // namespace Dune
#endif // DUNE_COMMON_SIMD_STANDARD_HH
indices.hh
defaults.hh
Default implementations for SIMD Implementations.
base.hh
Basic definitions for SIMD Implementations.
Dune::index_constant
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition indices.hh:29
Dune::Simd::Overloads::mask
Mask< V > mask(ADLTag< 0, std::is_same< V, Mask< V > >::value >, const V &v)
implements Simd::mask()
Definition defaults.hh:153
Dune::Simd::Overloads::allFalse
bool allFalse(ADLTag< 0 >, const Mask &mask)
implements Simd::allFalse()
Definition defaults.hh:124
Dune::Simd::Overloads::allTrue
bool allTrue(ADLTag< 0 >, const Mask &mask)
implements Simd::allTrue()
Definition defaults.hh:104
Dune::Simd::Overloads::anyFalse
bool anyFalse(ADLTag< 0 >, const Mask &mask)
implements Simd::anyFalse()
Definition defaults.hh:114
Dune
Dune namespace
Definition alignedallocator.hh:13
Dune::Simd
Namespace for vectorization interface functions used by library developers.
Definition debugalign.hh:518
Dune::Simd::Overloads
Namespace for the overloads and specializations that make up a SIMD implementation.
Definition debugalign.hh:519
Dune::Simd::Overloads::anyTrue
bool anyTrue(ADLTag< 5 >, const AlignedNumber< bool, align > &mask)
Definition debugalign.hh:556
Dune::Simd::Overloads::lane
T & lane(ADLTag< 5 >, std::size_t l, AlignedNumber< T, align > &v)
Definition debugalign.hh:533
Dune::Simd::Overloads::ADLTag
Tag used to force late-binding lookup in Dune::Simd::Overloads.
Definition base.hh:182
Dune::Simd::Overloads::ScalarType
should have a member type type
Definition standard.hh:60
Dune::Simd::Overloads::ScalarType::type
V type
Definition standard.hh:60
Dune::Simd::Overloads::RebindType
should have a member type type
Definition standard.hh:67
Dune::Simd::Overloads::RebindType::type
S type
Definition standard.hh:67
Dune::Simd::Overloads::LaneCount
should be derived from a Dune::index_constant
Definition standard.hh:74