dune-common 2.9.1
|
#include <dune/common/simd/test.hh>
Public Member Functions | |
template<class V , class Rebinds , template< class > class RebindPrune = IsLoop, template< class > class RebindAccept = Dune::AlwaysTrue> | |
void | check () |
run unit tests for simd vector type V | |
bool | good () const |
whether all tests succeeded | |
Test instantiation points | |
These functions should not be called directly, but serve as explicit instantiation points to keep memory usage bounded during compilation. There should be an explicit instantiation declaration ( If explicitly instantiating the top-level instantiation point Each instantiation point in the hierarchy implicitly instantiates its descendants, unless there are explicit instantiation declarations for them. However, for future-proofing it can make sense to explicitly instantiate nodes in the hierarchy even if all their children are already explicitly instantiated. This will limit the impact of instantiation points added in the future. For an example of how to do the instantiations, look at Background: The compiler can use a lot of memory when compiling a unit test for many Simd vector types. E.g. for standardtest.cc, which tests all the fundamental arithmetic types plus One mitigation was to explicitly instantiate The second mitigation was to define | |
template<class V > | |
void | checkType () |
template<class V > | |
void | checkNonOps () |
template<class V > | |
void | checkUnaryOps () |
template<class V > | |
void | checkBinaryOps () |
template<class V > | |
void | checkBinaryOpsVectorVector () |
template<class V > | |
void | checkBinaryOpsScalarVector () |
template<class V > | |
void | checkBinaryOpsVectorScalar () |
template<class V > | |
void | checkBinaryOpsProxyVector () |
template<class V > | |
void | checkBinaryOpsVectorProxy () |
|
inline |
run unit tests for simd vector type V
This function will also ensure that check<W>()
is run, for any type W = Rebind<R, V>
where R
is in Rebinds
, and RebindPrune<W>::value == false
. No test will be run twice for a given type.
If the result of Rebind
is not pruned by RebindPrune
, it will be passed to RebindAccept
. If that rejects the type, a static assertion will trigger.
Rebinds | A list of types, usually in the form of a TypeList . |
RebindPrune | A type predicate determining whether to run check() for types obtained from Rebinds . |
RebindAccept | A type predicate determining whether a type is acceptable as the result of a Rebind . |
|
inline |
whether all tests succeeded