10 template <QudaReconstructType recon> constexpr
bool is_enabled() {
return true; }
11 #if !(QUDA_RECONSTRUCT & 4)
14 #if !(QUDA_RECONSTRUCT & 2)
18 #if !(QUDA_RECONSTRUCT & 1)
24 static constexpr std::array<QudaReconstructType, 5>
recon
29 static constexpr std::array<QudaReconstructType, 3>
recon
34 static constexpr std::array<QudaReconstructType, 3>
recon
58 template <
bool enabled,
template <
typename,
int, QudaReconstructType>
class Apply,
typename Float,
int nColor,
68 template <
template <
typename,
int, QudaReconstructType>
class Apply,
typename Float,
int nColor,
73 errorQuda(
"QUDA_RECONSTRUCT=%d does not enable %d", QUDA_RECONSTRUCT, recon);
81 template <
template <
typename,
int, QudaReconstructType>
class Apply,
typename Float,
int nColor,
typename Recon,
82 int i,
typename G,
typename... Args>
86 if (U.Reconstruct() == Recon::recon[i]) {
97 template <
template <
typename,
int, QudaReconstructType>
class Apply,
typename Float,
int nColor,
typename Recon,
98 typename G,
typename... Args>
102 if (U.Reconstruct() == Recon::recon[0]) {
105 errorQuda(
"Unsupported reconstruct type %d\n", U.Reconstruct());
115 template <
template <
typename,
int, QudaReconstructType>
class Apply,
typename Recon,
typename Float,
typename G,
119 if (U.Ncolor() == 3) {
120 constexpr
int i = Recon::recon.size() - 1;
123 errorQuda(
"Unsupported number of colors %d\n", U.Ncolor());
132 template <
template <
typename,
int, QudaReconstructType>
class Apply,
typename Recon = ReconstructFull,
typename G,
137 #if QUDA_PRECISION & 8
138 instantiate<Apply, Recon, double>(U, args...);
140 errorQuda(
"QUDA_PRECISION=%d does not enable double precision", QUDA_PRECISION);
143 #if QUDA_PRECISION & 4
144 instantiate<Apply, Recon, float>(U, args...);
146 errorQuda(
"QUDA_PRECISION=%d does not enable single precision", QUDA_PRECISION);
149 errorQuda(
"Unsupported precision %d\n", U.Precision());
153 #if defined(__CUDA_ARCH__) && __CUDACC_VER_MAJOR__ <= 9
162 template <
template <
typename>
class Apply,
typename C,
typename... Args>
166 #if QUDA_PRECISION & 8
167 Apply<double>(c, args...);
169 errorQuda(
"QUDA_PRECISION=%d does not enable double precision", QUDA_PRECISION);
172 #if QUDA_PRECISION & 4
173 Apply<float>(c, args...);
175 errorQuda(
"QUDA_PRECISION=%d does not enable single precision", QUDA_PRECISION);
178 #if QUDA_PRECISION & 2
179 Apply<short>(c, args...);
181 errorQuda(
"QUDA_PRECISION=%d does not enable half precision", QUDA_PRECISION);
184 #if QUDA_PRECISION & 1
185 Apply<int8_t>(c, args...);
187 errorQuda(
"QUDA_PRECISION=%d does not enable quarter precision", QUDA_PRECISION);
190 errorQuda(
"Unsupported precision %d\n", c.Precision());
199 template <
template <
typename,
int>
class Apply,
typename store_t,
typename F,
typename... Args>
202 if (field.Ncolor() == 3) {
203 Apply<store_t, 3>(field, args...);
205 errorQuda(
"Unsupported number of colors %d\n", field.Ncolor());
209 #if defined(__CUDA_ARCH__) && __CUDACC_VER_MAJOR__ <= 9
211 #define constexpr constexpr
220 template <
template <
typename,
int>
class Apply,
typename F,
typename... Args>
224 #if QUDA_PRECISION & 8
225 instantiate<Apply, double>(field, args...);
227 errorQuda(
"QUDA_PRECISION=%d does not enable double precision", QUDA_PRECISION);
230 #if QUDA_PRECISION & 4
231 instantiate<Apply, float>(field, args...);
233 errorQuda(
"QUDA_PRECISION=%d does not enable single precision", QUDA_PRECISION);
236 #if QUDA_PRECISION & 2
237 instantiate<Apply, short>(field, args...);
239 errorQuda(
"QUDA_PRECISION=%d does not enable half precision", QUDA_PRECISION);
242 #if QUDA_PRECISION & 1
243 instantiate<Apply, int8_t>(field, args...);
245 errorQuda(
"QUDA_PRECISION=%d does not enable quarter precision", QUDA_PRECISION);
248 errorQuda(
"Unsupported precision %d\n", field.Precision());
263 template <
template <
typename>
class Apply,
typename F,
typename... Args>
268 Apply<double>(field, args...);
270 #if QUDA_PRECISION & 4
271 Apply<float>(field, args...);
273 errorQuda(
"QUDA_PRECISION=%d does not enable single precision", QUDA_PRECISION);
276 #if QUDA_PRECISION & 2
277 Apply<short>(field, args...);
279 errorQuda(
"QUDA_PRECISION=%d does not enable half precision", QUDA_PRECISION);
282 #if QUDA_PRECISION & 1
283 Apply<int8_t>(field, args...);
285 errorQuda(
"QUDA_PRECISION=%d does not enable quarter precision", QUDA_PRECISION);
288 errorQuda(
"Unsupported precision %d\n", field.Precision());
308 template <
template <
typename,
typename>
class Apply,
typename T,
typename F,
typename... Args>
313 Apply<double, T>(field, args...);
315 #if QUDA_PRECISION & 4
316 Apply<float, T>(field, args...);
318 errorQuda(
"QUDA_PRECISION=%d does not enable single precision", QUDA_PRECISION);
321 #if QUDA_PRECISION & 2
322 Apply<short, T>(field, args...);
324 errorQuda(
"QUDA_PRECISION=%d does not enable half precision", QUDA_PRECISION);
327 #if QUDA_PRECISION & 1
328 Apply<int8_t, T>(field, args...);
330 errorQuda(
"QUDA_PRECISION=%d does not enable quarter precision", QUDA_PRECISION);
333 errorQuda(
"Unsupported precision %d\n", field.Precision());
344 template <
template <
typename>
class Apply,
typename F,
typename... Args>
348 #ifdef GPU_MULTIGRID_DOUBLE
349 Apply<double>(field, args...);
351 errorQuda(
"Multigrid not support in double precision");
354 #if QUDA_PRECISION & 4
355 Apply<float>(field, args...);
357 errorQuda(
"QUDA_PRECISION=%d does not enable single precision", QUDA_PRECISION);
360 #if QUDA_PRECISION & 2
361 Apply<short>(field, args...);
363 errorQuda(
"QUDA_PRECISION=%d does not enable half precision", QUDA_PRECISION);
366 #if QUDA_PRECISION & 1
367 Apply<int8_t>(field, args...);
369 errorQuda(
"QUDA_PRECISION=%d does not enable quarter precision", QUDA_PRECISION);
372 errorQuda(
"Unsupported precision %d\n", field.Precision());
379 static constexpr std::array<QudaReconstructType, 3>
recon
384 static constexpr std::array<QudaReconstructType, 3>
recon
enum QudaReconstructType_s QudaReconstructType
constexpr void instantiate(G &U, Args &&... args)
This instantiate function is used to instantiate the colors.
constexpr bool is_enabled()
constexpr bool is_enabled< QUDA_RECONSTRUCT_13 >()
constexpr bool is_enabled< QUDA_RECONSTRUCT_12 >()
constexpr void instantiatePrecisionMG(F &field, Args &&... args)
The instantiatePrecision function is used to instantiate the precision.
constexpr bool is_enabled< QUDA_RECONSTRUCT_NO >()
constexpr bool is_enabled< QUDA_RECONSTRUCT_9 >()
constexpr void instantiatePrecision2(F &field, Args &&... args)
The instantiatePrecision2 function is used to instantiate the precision for a class that accepts 2 ty...
constexpr void instantiatePrecision(F &field, Args &&... args)
The instantiatePrecision function is used to instantiate the precision. Note unlike the "instantiate"...
constexpr bool is_enabled< QUDA_RECONSTRUCT_8 >()
FloatingPoint< float > Float
static constexpr std::array< QudaReconstructType, 1 > recon
static constexpr std::array< QudaReconstructType, 5 > recon
static constexpr std::array< QudaReconstructType, 2 > recon
static constexpr std::array< QudaReconstructType, 2 > recon
static constexpr std::array< QudaReconstructType, 1 > recon
static constexpr std::array< QudaReconstructType, 3 > recon
static constexpr std::array< QudaReconstructType, 3 > recon
static constexpr std::array< QudaReconstructType, 3 > recon
static constexpr std::array< QudaReconstructType, 3 > recon
instantiateApply(G &U, Args &&... args)
This class instantiates the Apply class based on the instantiated templates below.
instantiateApply(G &U, Args &&... args)
instantiateReconstruct(G &U, Args &&... args)
Instantiate the reconstruction template at index i and recurse to prior element.
instantiateReconstruct(G &U, Args &&... args)