9 template <
typename Gauge>
21 for (
int dir=0; dir<4; ++dir){
22 border[dir] = data.
R()[dir];
23 E[dir] = data.
X()[dir];
24 X[dir] = data.
X()[dir] - border[dir]*2;
27 threads = X[0]*X[1]*X[2]*X[3]/2;
31 template<
typename Float,
typename Arg>
35 int dx[4] = {0, 0, 0, 0};
48 template<
int blockSize,
typename Float,
typename Gauge>
50 int idx = threadIdx.x + blockIdx.x*blockDim.x;
53 double2 plaq = make_double2(0.0,0.0);
58 for (
int dr=0; dr<4; ++dr) x[dr] += arg.
border[dr];
60 for (
int mu = 0;
mu < 3;
mu++) {
61 for (
int nu = (
mu+1); nu < 3; nu++) {
68 idx += blockDim.x*gridDim.x;
72 reduce2d<blockSize,2>(
arg, plaq);
static __device__ __host__ int linkIndexShift(const I x[], const J dx[], const K X[4])
__global__ void computePlaq(GaugePlaqArg< Gauge > arg)
Main header file for host and device accessors to GaugeFields.
GaugePlaqArg(const Gauge &dataOr, const GaugeField &data)
__device__ __host__ T getTrace(const Matrix< T, 3 > &a)
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
__host__ __device__ ValueType conj(ValueType x)
double3 plaquette(const GaugeField &U)
Compute the plaquette of the gauge field.
__host__ __device__ int getCoords(int coord[], const Arg &arg, int &idx, int parity, int &dim)
Compute the space-time coordinates we are at.