mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Photon syntax gave problems with NVCC
This commit is contained in:
parent
4bf86ae60a
commit
7df58dd883
@ -71,9 +71,9 @@ public:
|
|||||||
void StochasticField(GaugeField &out, GridParallelRNG &rng);
|
void StochasticField(GaugeField &out, GridParallelRNG &rng);
|
||||||
void StochasticField(GaugeField &out, GridParallelRNG &rng,
|
void StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||||
const GaugeLinkField &weight);
|
const GaugeLinkField &weight);
|
||||||
void UnitField(GaugeField &out);
|
void UnitField(GaugeField &out);
|
||||||
private:
|
private:
|
||||||
void infVolPropagator(GaugeLinkField &out);
|
void infVolPropagator(GaugeLinkField &out);
|
||||||
void invKHatSquared(GaugeLinkField &out);
|
void invKHatSquared(GaugeLinkField &out);
|
||||||
void zmSub(GaugeLinkField &out);
|
void zmSub(GaugeLinkField &out);
|
||||||
private:
|
private:
|
||||||
@ -123,34 +123,37 @@ void Photon<Gimpl>::FreePropagator (const GaugeField &in,GaugeField &out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class Gimpl>
|
template<class Gimpl>
|
||||||
void Photon<Gimpl>::infVolPropagator(GaugeLinkField &out)
|
void Photon<Gimpl>::infVolPropagator(GaugeLinkField &out)
|
||||||
{
|
{
|
||||||
auto *grid = dynamic_cast<GridCartesian *>(out.Grid());
|
auto *grid = dynamic_cast<GridCartesian *>(out.Grid());
|
||||||
LatticeReal xmu(grid);
|
LatticeReal xmu(grid);
|
||||||
GaugeLinkField one(grid);
|
LatticeReal pmusq(grid);
|
||||||
const unsigned int nd = grid->_ndimension;
|
LatticeComplex pmusq_z(grid);
|
||||||
Coordinate &l = grid->_fdimensions;
|
GaugeLinkField one(grid);
|
||||||
Coordinate x0(nd,0);
|
const unsigned int nd = grid->_ndimension;
|
||||||
TComplex Tone = Complex(1.0,0.0);
|
Coordinate &l = grid->_fdimensions;
|
||||||
TComplex Tzero = Complex(G0_,0.0);
|
Coordinate x0(nd,0);
|
||||||
FFT fft(grid);
|
TComplex Tone = Complex(1.0,0.0);
|
||||||
|
TComplex Tzero = Complex(G0_,0.0);
|
||||||
|
FFT fft(grid);
|
||||||
|
|
||||||
one = Complex(1.0,0.0);
|
one = Complex(1.0,0.0);
|
||||||
out = Zero();
|
out = Zero();
|
||||||
for(int mu = 0; mu < nd; mu++)
|
for(int mu = 0; mu < nd; mu++) {
|
||||||
{
|
LatticeCoordinate(xmu,mu);
|
||||||
LatticeCoordinate(xmu,mu);
|
Real lo2 = l[mu]/2.0;
|
||||||
Real lo2 = l[mu]/2.0;
|
xmu = where(xmu < lo2, xmu, xmu-double(l[mu]));
|
||||||
xmu = where(xmu < lo2, xmu, xmu-double(l[mu]));
|
pmusq = (4.0*M_PI*M_PI)*xmu*xmu;
|
||||||
out = out + toComplex(4*M_PI*M_PI*xmu*xmu);
|
pmusq_z= toComplex(pmusq);
|
||||||
}
|
out = out + pmusq_z;
|
||||||
pokeSite(Tone, out, x0);
|
|
||||||
out = one/out;
|
|
||||||
pokeSite(Tzero, out, x0);
|
|
||||||
fft.FFT_all_dim(out, out, FFT::forward);
|
|
||||||
}
|
}
|
||||||
|
pokeSite(Tone, out, x0);
|
||||||
|
out = one/out;
|
||||||
|
pokeSite(Tzero, out, x0);
|
||||||
|
fft.FFT_all_dim(out, out, FFT::forward);
|
||||||
|
}
|
||||||
|
|
||||||
template<class Gimpl>
|
template<class Gimpl>
|
||||||
void Photon<Gimpl>::invKHatSquared(GaugeLinkField &out)
|
void Photon<Gimpl>::invKHatSquared(GaugeLinkField &out)
|
||||||
{
|
{
|
||||||
GridBase *grid = out.Grid();
|
GridBase *grid = out.Grid();
|
||||||
|
@ -94,7 +94,7 @@ public:
|
|||||||
for (int mu = 0; mu < Ndim; mu++)
|
for (int mu = 0; mu < Ndim; mu++)
|
||||||
{
|
{
|
||||||
// pshift = Cshift(p, mu, +1); // not efficient, implement with stencils
|
// pshift = Cshift(p, mu, +1); // not efficient, implement with stencils
|
||||||
parallel_for(int i = 0; i < p.Grid()->oSites(); i++)
|
thread_loop( (int i = 0; i < p.Grid()->oSites(); i++),
|
||||||
{
|
{
|
||||||
int permute_type;
|
int permute_type;
|
||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
{
|
{
|
||||||
action_v[i] -= phiStencil.CommBuf()[SE->_offset] * (*t_p) + (*t_p) * phiStencil.CommBuf()[SE->_offset];
|
action_v[i] -= phiStencil.CommBuf()[SE->_offset] * (*t_p) + (*t_p) * phiStencil.CommBuf()[SE->_offset];
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// action -= pshift*p + p*pshift;
|
// action -= pshift*p + p*pshift;
|
||||||
}
|
}
|
||||||
// NB the trace in the algebra is normalised to 1/2
|
// NB the trace in the algebra is normalised to 1/2
|
||||||
@ -137,7 +137,7 @@ public:
|
|||||||
|
|
||||||
phiStencil.HaloExchange(p, compressor);
|
phiStencil.HaloExchange(p, compressor);
|
||||||
double halo_t = usecond();
|
double halo_t = usecond();
|
||||||
int chunk = 128;
|
// int chunk = 128;
|
||||||
//for (int mu = 0; mu < Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
//for (int mu = 0; mu < Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||||
|
|
||||||
// inverting the order of the loops slows down the code(! g++ 7)
|
// inverting the order of the loops slows down the code(! g++ 7)
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
const vobj *temp;
|
const vobj *temp;
|
||||||
|
|
||||||
parallel_for (int i = 0; i < p.Grid()->oSites(); i++) {
|
thread_loop( (int i = 0; i < p.Grid()->oSites(); i++) ,{
|
||||||
|
|
||||||
SE = phiStencil.GetEntry(permute_type, point, i);
|
SE = phiStencil.GetEntry(permute_type, point, i);
|
||||||
// prefetch next p?
|
// prefetch next p?
|
||||||
@ -171,7 +171,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
force_v[i] -= phiStencil.CommBuf()[SE->_offset];
|
force_v[i] -= phiStencil.CommBuf()[SE->_offset];
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
force *= N / g;
|
force *= N / g;
|
||||||
|
|
||||||
|
@ -980,7 +980,7 @@ void A2Autils<FImpl>::ContractWWVV(std::vector<PropagatorField> &WWVV,
|
|||||||
{
|
{
|
||||||
GridBase *grid = vs[0].Grid();
|
GridBase *grid = vs[0].Grid();
|
||||||
|
|
||||||
int nd = grid->_ndimension;
|
// int nd = grid->_ndimension;
|
||||||
int Nsimd = grid->Nsimd();
|
int Nsimd = grid->Nsimd();
|
||||||
int N_t = WW_sd.dimension(0);
|
int N_t = WW_sd.dimension(0);
|
||||||
int N_s = WW_sd.dimension(1);
|
int N_s = WW_sd.dimension(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user