SUNphi  1.0
Wrap.hpp
Go to the documentation of this file.
1 #ifndef _WRAP_HPP
2 #define _WRAP_HPP
3 
4 /// \file Wrap.hpp
5 ///
6 /// \brief Header file for the definition of \c Wrapper
7 ///
8 /// Blocks any kind of simplification of the bound \c SmET: a wrapped
9 /// smet is not mergeable, vectorizable, and no pattern recognition
10 /// works on nested smet
11 
12 #include <smet/NnarySmET.hpp>
13 #include <smet/Transpose.hpp>
14 #include <tens/TensKind.hpp>
15 
16 namespace SUNphi
17 {
18  // Base type to qualify as \c Wrapper
19  DEFINE_BASE_TYPE(Wrapper);
20 
21  /// Class to wrap a \c SmET
22  template <typename..._Refs> // Type of the expression to wrap
23  class Wrapper :
24  public BaseWrapper, // Inherit from \c BaseWrapper to detect in expression
25  public NnarySmET<Wrapper<_Refs...>>, // Inherit from \c NnarySmET
26  public ConstrainAreSmETs<_Refs...> // Constrain all \c _Refs to be \ SmET
27  {
28  public:
29 
31 
33 
35 
36  // Attributes
39 
41 
42  PROVIDE_EXTRA_MERGE_DELIMS(IntsUpTo<Tk::nTypes+1>);
43 
45 
47  };
48 
49  // Check that a test \c Wrapper is a \c NnarySmET
50  STATIC_ASSERT_IS_NNARY_SMET(Wrapper<Tens<TensKind<TensComp<double,3>>,double>>);
51 
52  // Build \c Wrapper from \c wrap
53  SIMPLE_NNARY_SMET_BUILDER(wrap,Wrapper);
54 
55  // Simplifies wrap(wrap)
57 }
58 
59 #endif
#define SAME_TK_AS_REF(ID)
Get the same TensKind of a given ref.
Definition: NnarySmET.hpp:201
#define PROVIDE_SIMPLE_NNARY_COMP_SIZE
Definition: NnarySmET.hpp:151
#define IDENTITY_REPRESENTATIVE_FUNCTION
Provide an identity representative function.
Definition: NnarySmET.hpp:29
#define REPRESENTATIVE_FUNCTION_WINS_ALL
Provides Fund, eval and mergedComps according to representativeFunction.
Definition: NnarySmET.hpp:432
#define FORWARD_IS_ALIASING_TO_REFS
Definition: NnarySmET.hpp:420
#define PROVIDE_NNARY_SMET_SIMPLE_CREATOR(NNARY_SMET)
Defines a simple creator taking n references.
Definition: NnarySmET.hpp:383
#define STATIC_ASSERT_IS_NNARY_SMET(...)
Defines the check for a Nnary SmET.
Definition: NnarySmET.hpp:394
#define PROVIDE_EXTRA_MERGE_DELIMS(...)
Add an ExtraDelims IntSeq called ExtraDelims.
Definition: NnarySmET.hpp:313
#define NOT_STORING
Set the SmET to not-storing.
Definition: BaseSmET.hpp:86
#define SIMPLE_NNARY_SMET_BUILDER(BUILDER,NNARY_SMET)
Definition: NnarySmET.hpp:406
#define PROVIDE_NNARY_SMET_REFS_AND_CHECK_ARE_N(N)
Definition: NnarySmET.hpp:126
#define ABSORB_DUPLICATED_NNARY_SMET_CALL(CALLER,NNARY_SMET)
Definition: NnarySmET.hpp:515
#define DEFINE_BASE_TYPE(TYPE,...)
Definition: TypeTraits.hpp:526