9 template <
typename Float,
typename GaugeOr,
typename GaugeDs>
struct GaugeAPEArg {
26 for (
int dir = 0; dir < 4; ++dir) {
27 border[dir] = data.
R()[dir];
28 X[dir] = data.
X()[dir] - border[dir] * 2;
35 template <
typename Float,
typename Arg,
typename Link>
41 for (
int dr = 0; dr < 4; ++dr) X[dr] = arg.X[dr];
45 for (
int dr = 0; dr < 4; ++dr) {
46 x[dr] += arg.border[dr];
47 X[dr] += 2 * arg.border[dr];
53 for (
int mu = 0;
mu < 3;
mu++) {
60 int dx[4] = {0, 0, 0, 0};
76 staple = staple + U1 * U2 *
conj(U3);
90 staple = staple +
conj(U1) * U2 * U3;
99 int idx = threadIdx.x + blockIdx.x * blockDim.x;
100 int parity = threadIdx.y + blockIdx.y * blockDim.y;
101 int dir = threadIdx.z + blockIdx.z * blockDim.z;
102 if (idx >= arg.threads)
return;
103 if (dir >= 3)
return;
104 typedef complex<Float>
Complex;
108 for (
int dr = 0; dr < 4; ++dr) X[dr] = arg.X[dr];
112 for (
int dr = 0; dr < 4; ++dr) {
113 x[dr] += arg.border[dr];
114 X[dr] += 2 * arg.border[dr];
117 int dx[4] = {0, 0, 0, 0};
122 computeStaple<Float>(
arg, idx,
parity, dir, S);
134 S = S * (arg.alpha / ((Float)(2. * (3. - 1.))));
137 TestU = I * (1. - arg.alpha) + S *
conj(U);
138 polarSu3<Float>(TestU, arg.tolerance);
__global__ void computeAPEStep(Arg arg)
__device__ __host__ void setZero(Matrix< T, N > *m)
static __device__ __host__ int linkIndexShift(const I x[], const J dx[], const K X[4])
GaugeAPEArg(GaugeOr &origin, GaugeDs &dest, const GaugeField &data, const Float alpha, const Float tolerance)
This is just a dummy structure we use for trove to define the required structure size.
__host__ __device__ void computeStaple(Arg &arg, int idx, int parity, int dir, Link &staple)
Main header file for host and device accessors to GaugeFields.
std::complex< double > Complex
__device__ __host__ void setIdentity(Matrix< T, N > *m)
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
__host__ __device__ ValueType conj(ValueType x)
__host__ __device__ int getCoords(int coord[], const Arg &arg, int &idx, int parity, int &dim)
Compute the space-time coordinates we are at.