3 #define FINE_GRAINED_ACCESS 9 template <
typename sFloatOut,
typename sFloatIn,
int Nc,
typename InOrder>
15 constexpr
int length = 2*Nc*Nc;
20 #ifdef FINE_GRAINED_ACCESS 25 InOrder in_(const_cast<GaugeField&>(in));
33 #ifdef FINE_GRAINED_ACCESS 36 copyGauge<FloatOut,FloatIn,length>(G(out,(
void*)Out,(
void**)outGhost), inOrder,
out,
in, location, type);
39 copyGauge<FloatOut,FloatIn,length>(G(out,(
void*)Out,(
void**)outGhost), inOrder,
out,
in, location, type);
43 copyGauge<FloatOut,FloatIn,length>
44 (G(out,Out,outGhost), inOrder,
out,
in, location, type);
49 #ifdef FINE_GRAINED_ACCESS 51 copyGauge<FloatOut,FloatIn,length>(G(out,(
void*)Out,(
void**)outGhost), inOrder,
out,
in, location, type);
54 copyGauge<FloatOut,FloatIn,length>(G(out, Out, outGhost), inOrder,
out,
in, location, type);
59 #ifdef FINE_GRAINED_ACCESS 61 copyGauge<FloatOut,FloatIn,length>(G(out,(
void*)Out,(
void**)outGhost), inOrder,
out,
in, location, type);
64 copyGauge<FloatOut,FloatIn,length>(G(out, Out, outGhost), inOrder,
out,
in, location, type);
73 template <
typename sFloatOut,
typename sFloatIn,
int Nc>
75 sFloatOut *Out, sFloatIn *In, sFloatOut **outGhost, sFloatIn **inGhost,
int type) {
79 #ifndef FINE_GRAINED_ACCESS 80 constexpr
int length = 2*Nc*Nc;
87 #ifdef FINE_GRAINED_ACCESS 90 copyGaugeMG<sFloatOut,sFloatIn,Nc> (G(const_cast<GaugeField&>(in),(
void*)In,(
void**)inGhost),
out,
in, location, Out, outGhost, type);
93 copyGaugeMG<sFloatOut,sFloatIn,Nc> (G(const_cast<GaugeField&>(in),(
void*)In,(
void**)inGhost),
out,
in, location, Out, outGhost, type);
97 copyGaugeMG<FloatOut,FloatIn,Nc> (G(in, In,inGhost),
out,
in, location, Out, outGhost, type);
101 #ifdef FINE_GRAINED_ACCESS 103 copyGaugeMG<sFloatOut,sFloatIn,Nc>(G(const_cast<GaugeField&>(in),(
void*)In,(
void**)inGhost),
out,
in, location, Out, outGhost, type);
106 copyGaugeMG<FloatOut,FloatIn,Nc>(G(in, In, inGhost),
out,
in, location, Out, outGhost, type);
111 #ifdef FINE_GRAINED_ACCESS 113 copyGaugeMG<sFloatOut,sFloatIn,Nc>(G(const_cast<GaugeField&>(in),(
void*)In,(
void**)inGhost),
out,
in, location, Out, outGhost, type);
116 copyGaugeMG<FloatOut,FloatIn,Nc>(G(in, In, inGhost),
out,
in, location, Out, outGhost, type);
125 template <
typename FloatOut,
typename FloatIn>
127 FloatIn *In, FloatOut **outGhost, FloatIn **inGhost,
int type) {
131 case 8: copyGaugeMG<FloatOut,FloatIn, 8>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
132 case 12: copyGaugeMG<FloatOut,FloatIn,12>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
133 case 16: copyGaugeMG<FloatOut,FloatIn,16>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
134 case 24: copyGaugeMG<FloatOut,FloatIn,24>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
135 case 32: copyGaugeMG<FloatOut,FloatIn,32>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
136 case 40: copyGaugeMG<FloatOut,FloatIn,40>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
137 case 48: copyGaugeMG<FloatOut,FloatIn,48>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
138 case 56: copyGaugeMG<FloatOut,FloatIn,56>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
139 case 64: copyGaugeMG<FloatOut,FloatIn,64>(
out,
in, location, Out, In, outGhost, inGhost, type);
break;
140 #endif // GPU_MULTIGRID 141 default:
errorQuda(
"Unsupported number of colors; out.Nc=%d, in.Nc=%d", out.Ncolor(), in.Ncolor());
147 void *Out,
void *In,
void **ghostOut,
void **ghostIn,
int type) {
149 #ifndef FINE_GRAINED_ACCESS 151 errorQuda(
"Precision format not supported");
155 #ifdef GPU_MULTIGRID_DOUBLE 157 copyGaugeMG(out, in, location, (
double*)Out, (
double*)In, (
double**)ghostOut, (
double**)ghostIn, type);
159 copyGaugeMG(out, in, location, (
double*)Out, (
float*)In, (
double**)ghostOut, (
float**)ghostIn, type);
161 copyGaugeMG(out, in, location, (
double*)Out, (
short*)In, (
double**)ghostOut, (
short**)ghostIn, type);
166 errorQuda(
"Double precision multigrid has not been enabled");
170 #ifdef GPU_MULTIGRID_DOUBLE 171 copyGaugeMG(out, in, location, (
float*)Out, (
double*)In, (
float**)ghostOut, (
double**)ghostIn, type);
173 errorQuda(
"Double precision multigrid has not been enabled");
176 copyGaugeMG(out, in, location, (
float*)Out, (
float*)In, (
float**)ghostOut, (
float**)ghostIn, type);
178 copyGaugeMG(out, in, location, (
float*)Out, (
short*)In, (
float**)ghostOut, (
short**)ghostIn, type);
184 #ifdef GPU_MULTIGRID_DOUBLE 185 copyGaugeMG(out, in, location, (
short*)Out, (
double*)In, (
short**)ghostOut, (
double**)ghostIn, type);
187 errorQuda(
"Double precision multigrid has not been enabled");
190 copyGaugeMG(out, in, location, (
short*)Out, (
float*)In, (
short**)ghostOut, (
float**)ghostIn, type);
192 copyGaugeMG(out, in, location, (
short*)Out, (
short*)In, (
short**)ghostOut, (
short**)ghostIn, type);
double abs_max(int dim=-1) const
Compute the absolute maximum of the field (Linfinity norm)
void copyGaugeMG(const InOrder &inOrder, GaugeField &out, const GaugeField &in, QudaFieldLocation location, sFloatOut *Out, sFloatOut **outGhost, int type)
Main header file for host and device accessors to GaugeFields.
enum QudaFieldLocation_s QudaFieldLocation
cpuColorSpinorField * out
void copyGenericGaugeMG(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out, void *In, void **ghostOut, void **ghostIn, int type)
QudaReconstructType Reconstruct() const
QudaGaugeFieldOrder Order() const
QudaPrecision Precision() const