1 #ifndef QPHIX_VEC_TRAITS_H
2 #define QPHIX_VEC_TRAITS_H
8 namespace QPhiXVecTraits {
12 static const int Vec=1;
13 static const int Soa=1;
14 static const bool compress12=
false;
17 template<
typename TOuter,
typename TInner>
18 struct MixedVecTraits {
19 static const int Vec=1;
20 static const int Soa=1;
21 static const bool compress12=
false;
22 static const int VecInner=1;
23 static const int SoaInner=1;
27 #if defined(CHROMA_QPHIX_ARCH_SSE)
28 #warning QPHIX for SSE
31 struct VecTraits<float> {
32 static const int Vec=4;
33 static const int Soa=CHROMA_QPHIX_SOALEN;
34 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
38 struct VecTraits<double> {
39 static const int Vec=2;
40 static const int Soa=CHROMA_QPHIX_SOALEN;
41 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
47 struct MixedVecTraits<double,double> {
48 static const int Vec=2;
49 static const int Soa=CHROMA_QPHIX_SOALEN;
50 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
51 static const int VecInner=2;
52 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
56 struct MixedVecTraits<double,float> {
57 static const int Vec=2;
58 static const int Soa=CHROMA_QPHIX_SOALEN;
59 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
60 static const int VecInner=4;
61 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
65 struct MixedVecTraits<float,float> {
66 static const int Vec=4;
67 static const int Soa=CHROMA_QPHIX_SOALEN;
68 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
69 static const int VecInner=4;
70 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
76 #if defined(CHROMA_QPHIX_ARCH_AVX) || defined(CHROMA_QPHIX_ARCH_AVX2)
77 #warning QPHIX for AVX and AVX2
80 struct VecTraits<float> {
81 static const int Vec=8;
82 static const int Soa=CHROMA_QPHIX_SOALEN;
83 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
87 struct VecTraits<double> {
88 static const int Vec=4;
89 static const int Soa=CHROMA_QPHIX_SOALEN;
90 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
96 struct MixedVecTraits<double,double> {
97 static const int Vec=4;
98 static const int Soa=CHROMA_QPHIX_SOALEN;
99 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
100 static const int VecInner=4;
101 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
105 struct MixedVecTraits<double,float> {
106 static const int Vec=4;
107 static const int Soa=CHROMA_QPHIX_SOALEN;
108 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
109 static const int VecInner=8;
110 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
114 struct MixedVecTraits<float,float> {
115 static const int Vec=8;
116 static const int Soa=CHROMA_QPHIX_SOALEN;
117 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
118 static const int VecInner=8;
119 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
125 #if defined(CHROMA_QPHIX_ARCH_MIC) || defined(CHROMA_QPHIX_ARCH_AVX512)
126 #warning QPhiX for MIC or AVX512
129 struct VecTraits<float> {
130 static const int Vec=16;
131 static const int Soa=CHROMA_QPHIX_SOALEN;
132 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
136 struct VecTraits<double> {
137 static const int Vec=8;
138 static const int Soa=CHROMA_QPHIX_SOALEN;
139 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
144 struct MixedVecTraits<double,double> {
145 static const int Vec=8;
146 static const int Soa=CHROMA_QPHIX_SOALEN;
147 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
148 static const int VecInner=8;
149 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
153 struct MixedVecTraits<double,float> {
154 static const int Vec=8;
155 static const int Soa=CHROMA_QPHIX_SOALEN;
156 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
157 static const int VecInner=16;
158 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
161 struct MixedVecTraits<double,QPhiX::half> {
162 static const int Vec=8;
163 static const int Soa=CHROMA_QPHIX_SOALEN;
164 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
165 static const int VecInner=16;
166 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
169 struct MixedVecTraits<float,float> {
170 static const int Vec=16;
171 static const int Soa=CHROMA_QPHIX_SOALEN;
172 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
173 static const int VecInner=16;
174 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
178 struct MixedVecTraits<float,QPhiX::half> {
179 static const int Vec=16;
180 static const int Soa=CHROMA_QPHIX_SOALEN;
181 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
182 static const int VecInner=16;
183 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
188 #if defined CHROMA_QPHIX_ARCH_QPX
189 #warning QPhiX for QPX
192 struct VecTraits<double> {
193 static const int Vec=4;
194 static const int Soa=CHROMA_QPHIX_SOALEN;
195 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
199 struct MixedVecTraits<double,double> {
200 static const int Vec=4;
201 static const int Soa=CHROMA_QPHIX_SOALEN;
202 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
203 static const int VecInner=4;
204 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
208 struct MixedVecTraits<double,float> {
209 static const int Vec=4;
210 static const int Soa=CHROMA_QPHIX_SOALEN;
211 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
212 static const int VecInner=4;
213 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
218 struct MixedVecTraits<float,float> {
219 static const int Vec=4;
220 static const int Soa=CHROMA_QPHIX_SOALEN;
221 static const bool compress12=CHROMA_QPHIX_COMPRESS12;
222 static const int VecInner=4;
223 static const int SoaInner=CHROMA_QPHIX_INNER_SOALEN;
Asqtad Staggered-Dirac operator.