6 template <
typename FloatOut,
typename FloatIn,
int length,
typename InOrder>
16 const bool override =
true;
19 copyGauge<short,FloatIn,length>
24 copyGauge<FloatOut,FloatIn,length>
25 (G(
out, Out, outGhost,
override), inOrder,
out.
Volume(), faceVolumeCB,
30 copyGauge<FloatOut,FloatIn,length>
31 (G(
out, Out, outGhost,
override), inOrder,
out.
Volume(), faceVolumeCB,
35 copyGauge<FloatOut,FloatIn,length>
36 (G(
out, Out, outGhost,
override), inOrder,
out.
Volume(), faceVolumeCB,
38 #ifdef GPU_STAGGERED_DIRAC 41 copyGauge<FloatOut,FloatIn,length>
42 (G(
out, Out, outGhost,
override), inOrder,
out.
Volume(), faceVolumeCB,
46 copyGauge<FloatOut,FloatIn,length>
47 (G(
out, Out, outGhost,
override), inOrder,
out.
Volume(), faceVolumeCB,
51 errorQuda(
"Reconstruction %d and order %d not supported",
out.Reconstruct(),
out.Order());
55 #ifdef BUILD_QDP_INTERFACE 56 copyGauge<FloatOut,FloatIn,length>
60 errorQuda(
"QDP interface has not been built\n");
65 #ifdef BUILD_QDPJIT_INTERFACE 66 copyGauge<FloatOut,FloatIn,length>
70 errorQuda(
"QDPJIT interface has not been built\n");
75 #ifdef BUILD_CPS_INTERFACE 76 copyGauge<FloatOut,FloatIn,length>
80 errorQuda(
"CPS interface has not been built\n");
85 #ifdef BUILD_MILC_INTERFACE 86 copyGauge<FloatOut,FloatIn,length>
90 errorQuda(
"MILC interface has not been built\n");
95 #ifdef BUILD_MILC_INTERFACE 96 copyGauge<FloatOut,FloatIn,length>
100 errorQuda(
"MILC interface has not been built\n");
105 #ifdef BUILD_BQCD_INTERFACE 106 copyGauge<FloatOut,FloatIn,length>
110 errorQuda(
"BQCD interface has not been built\n");
115 #ifdef BUILD_TIFR_INTERFACE 116 copyGauge<FloatOut,FloatIn,length>
120 errorQuda(
"TIFR interface has not been built\n");
125 #ifdef BUILD_TIFR_INTERFACE 126 copyGauge<FloatOut,FloatIn,length>
130 errorQuda(
"TIFR interface has not been built\n");
134 errorQuda(
"Gauge field %d order not supported",
out.Order());
139 template <
typename FloatOut,
typename FloatIn,
int length>
141 FloatOut *Out, FloatIn *In, FloatOut **outGhost, FloatIn **inGhost,
int type) {
149 const bool override =
true;
153 (
in,(
short*)In,(
short**)inGhost,
override),
154 out,
in, location, Out, outGhost, type);
157 copyGauge<FloatOut,FloatIn,length> (G(
in,In,inGhost,
override),
out,
in, location, Out, outGhost, type);
161 copyGauge<FloatOut,FloatIn,length> (G(
in,In,inGhost,
override),
out,
in, location, Out, outGhost, type);
164 copyGauge<FloatOut,FloatIn,length> (G(
in,In,inGhost,
override),
out,
in, location, Out, outGhost, type);
165 #ifdef GPU_STAGGERED_DIRAC 168 copyGauge<FloatOut,FloatIn,length> (G(
in,In,inGhost,
override),
out,
in, location, Out, outGhost, type);
171 copyGauge<FloatOut,FloatIn,length> (G(
in,In,inGhost,
override),
out,
in, location, Out, outGhost, type);
174 errorQuda(
"Reconstruction %d and order %d not supported",
in.Reconstruct(),
in.Order());
178 #ifdef BUILD_QDP_INTERFACE 180 out,
in, location, Out, outGhost, type);
182 errorQuda(
"QDP interface has not been built\n");
187 #ifdef BUILD_QDPJIT_INTERFACE 189 out,
in, location, Out, outGhost, type);
191 errorQuda(
"QDPJIT interface has not been built\n");
196 #ifdef BUILD_CPS_INTERFACE 198 out,
in, location, Out, outGhost, type);
200 errorQuda(
"CPS interface has not been built\n");
205 #ifdef BUILD_MILC_INTERFACE 207 out,
in, location, Out, outGhost, type);
209 errorQuda(
"MILC interface has not been built\n");
214 #ifdef BUILD_MILC_INTERFACE 216 out,
in, location, Out, outGhost, type);
218 errorQuda(
"MILC interface has not been built\n");
223 #ifdef BUILD_BQCD_INTERFACE 225 out,
in, location, Out, outGhost, type);
227 errorQuda(
"BQCD interface has not been built\n");
232 #ifdef BUILD_TIFR_INTERFACE 234 out,
in, location, Out, outGhost, type);
236 errorQuda(
"TIFR interface has not been built\n");
241 #ifdef BUILD_TIFR_INTERFACE 243 out,
in, location, Out, outGhost, type);
245 errorQuda(
"TIFR interface has not been built\n");
249 errorQuda(
"Gauge field order %d not supported",
in.Order());
256 template <
typename FloatOut,
typename FloatIn,
int length,
typename Out,
typename In,
typename Arg>
260 copyGauge<FloatOut,FloatIn,length>(
arg);
265 errorQuda(
"Undefined field location %d for copyMom", location);
270 template <
typename FloatOut,
typename FloatIn>
272 FloatIn *In, FloatOut **outGhost, FloatIn **inGhost,
int type) {
278 if (
out.Geometry() !=
in.Geometry()) {
279 errorQuda(
"Field geometries %d %d do not match",
out.Geometry(),
in.Geometry());
284 copyGauge<FloatOut,FloatIn,18>(
out,
in, location, Out, In, outGhost, inGhost, type);
298 const bool override =
true;
305 CopyGaugeArg<momOut,momIn> arg(momOut(
out, Out, 0,
override), momIn(
in, In, 0,
override),
in.
Volume(),
306 faceVolumeCB,
in.
Ndim(),
in.Geometry());
307 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
309 #ifdef BUILD_MILC_INTERFACE 313 faceVolumeCB,
in.
Ndim(),
in.Geometry());
314 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
316 errorQuda(
"MILC interface has not been built\n");
319 #ifdef BUILD_MILC_INTERFACE 323 faceVolumeCB,
in.
Ndim(),
in.Geometry());
324 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
326 errorQuda(
"MILC interface has not been built\n");
329 #ifdef BUILD_TIFR_INTERFACE 333 faceVolumeCB,
in.
Ndim(),
in.Geometry());
334 copyMom<FloatOut,FloatIn,18,momOut,momIn>(
arg,
out,
in,location);
336 errorQuda(
"TIFR interface has not been built\n");
339 #ifdef BUILD_TIFR_INTERFACE 343 faceVolumeCB,
in.
Ndim(),
in.Geometry());
344 copyMom<FloatOut,FloatIn,18,momOut,momIn>(
arg,
out,
in,location);
346 errorQuda(
"TIFR interface has not been built\n");
349 errorQuda(
"Gauge field orders %d not supported",
in.Order());
353 #ifdef BUILD_MILC_INTERFACE 357 faceVolumeCB,
in.
Ndim(),
in.Geometry());
358 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
362 faceVolumeCB,
in.
Ndim(),
in.Geometry());
363 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
365 errorQuda(
"Gauge field orders %d not supported",
in.Order());
368 errorQuda(
"MILC interface has not been built\n");
372 #ifdef BUILD_MILC_INTERFACE 376 faceVolumeCB,
in.
Ndim(),
in.Geometry());
377 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
381 faceVolumeCB,
in.
Ndim(),
in.Geometry());
382 copyMom<FloatOut,FloatIn,10,momOut,momIn>(
arg,
out,
in,location);
384 errorQuda(
"Gauge field orders %d not supported",
in.Order());
387 errorQuda(
"MILC interface has not been built\n");
391 #ifdef BUILD_TIFR_INTERFACE 396 faceVolumeCB,
in.
Ndim(),
in.Geometry());
397 copyMom<FloatOut,FloatIn,18,momOut,momIn>(
arg,
out,
in,location);
401 faceVolumeCB,
in.
Ndim(),
in.Geometry());
402 copyMom<FloatOut,FloatIn,18,momOut,momIn>(
arg,
out,
in,location);
404 errorQuda(
"Gauge field orders %d not supported",
in.Order());
407 errorQuda(
"TIFR interface has not been built\n");
411 #ifdef BUILD_TIFR_INTERFACE 416 faceVolumeCB,
in.
Ndim(),
in.Geometry());
417 copyMom<FloatOut,FloatIn,18,momOut,momIn>(
arg,
out,
in,location);
421 faceVolumeCB,
in.
Ndim(),
in.Geometry());
422 copyMom<FloatOut,FloatIn,18,momOut,momIn>(
arg,
out,
in,location);
424 errorQuda(
"Gauge field orders %d not supported",
in.Order());
427 errorQuda(
"TIFR interface has not been built\n");
430 errorQuda(
"Gauge field orders %d not supported",
out.Order());
void apply(const cudaStream_t &stream)
void copyGauge(CopyGaugeArg< OutOrder, InOrder > arg)
const int * SurfaceCB() const
struct to define gauge fields packed into an opaque MILC site struct:
Main header file for host and device accessors to GaugeFields.
enum QudaFieldLocation_s QudaFieldLocation
cpuColorSpinorField * out
void copyMom(Arg &arg, const GaugeField &out, const GaugeField &in, QudaFieldLocation location)
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
Accessor routine for CloverFields in native field order.
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
void checkMomOrder(const GaugeField &u)
static __inline__ size_t size_t d