1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

cuda 9.1 fixes

This commit is contained in:
Peter Boyle 2019-07-01 07:29:22 +01:00
parent 6a13731818
commit 532e226b22
3 changed files with 8 additions and 6 deletions

View File

@ -51,7 +51,8 @@ public:
ComplexField coor(in.Grid()); ComplexField coor(in.Grid());
ComplexField ph(in.Grid()); ph = Zero(); ComplexField ph(in.Grid()); ph = Zero();
FermionField in_buf(in.Grid()); in_buf = Zero(); FermionField in_buf(in.Grid()); in_buf = Zero();
Complex ci(0.0,1.0); typedef typename Simd::scalar_type Scalar;
Scalar ci(0.0,1.0);
assert(twist.size() == Nd);//check that twist is Nd assert(twist.size() == Nd);//check that twist is Nd
int shift = 0; int shift = 0;
if(fiveD) shift = 1; if(fiveD) shift = 1;

View File

@ -97,6 +97,8 @@ public:
{ {
FFT theFFT((GridCartesian *) in.Grid()); FFT theFFT((GridCartesian *) in.Grid());
typedef typename Simd::scalar_type Scalar;
FermionField in_k(in.Grid()); FermionField in_k(in.Grid());
FermionField prop_k(in.Grid()); FermionField prop_k(in.Grid());
@ -104,21 +106,21 @@ public:
ComplexField coor(in.Grid()); ComplexField coor(in.Grid());
ComplexField ph(in.Grid()); ph = Zero(); ComplexField ph(in.Grid()); ph = Zero();
FermionField in_buf(in.Grid()); in_buf = Zero(); FermionField in_buf(in.Grid()); in_buf = Zero();
Complex ci(0.0,1.0); Scalar ci(0.0,1.0);
assert(twist.size() == Nd);//check that twist is Nd assert(twist.size() == Nd);//check that twist is Nd
for(unsigned int nu = 0; nu < Nd; nu++) for(unsigned int nu = 0; nu < Nd; nu++)
{ {
LatticeCoordinate(coor, nu); LatticeCoordinate(coor, nu);
ph = ph + twist[nu]*coor*((1./(in.Grid()->_fdimensions[nu]))); ph = ph + twist[nu]*coor*((1./(in.Grid()->_fdimensions[nu])));
} }
in_buf = exp((Real)(2.0*M_PI)*ci*ph*(-1.0))*in; in_buf = (exp(Scalar(2.0*M_PI)*ci*ph*(-1.0)))*in;
theFFT.FFT_all_dim(in_k,in_buf,FFT::forward); theFFT.FFT_all_dim(in_k,in_buf,FFT::forward);
this->MomentumSpacePropagator(prop_k,in_k,mass,twist); this->MomentumSpacePropagator(prop_k,in_k,mass,twist);
theFFT.FFT_all_dim(out,prop_k,FFT::backward); theFFT.FFT_all_dim(out,prop_k,FFT::backward);
//phase for boundary condition //phase for boundary condition
out = out * exp((Real)(2.0*M_PI)*ci*ph); out = out * exp(Scalar(2.0*M_PI)*ci*ph);
}; };
virtual void FreePropagator(const FermionField &in,FermionField &out,RealD mass) { virtual void FreePropagator(const FermionField &in,FermionField &out,RealD mass) {

View File

@ -175,8 +175,7 @@ public:
/*****************************************************/ /*****************************************************/
/* Have a decompression step if mpi data is not same */ /* Have a decompression step if mpi data is not same */
/*****************************************************/ /*****************************************************/
accelerator_inline void Decompress(SiteHalfSpinor *out, accelerator_inline void Decompress(SiteHalfSpinor *out, SiteHalfSpinor *in, Integer o){
SiteHalfSpinor *in, Integer o){
SiteHalfCommSpinor *hin=(SiteHalfCommSpinor *)in; SiteHalfCommSpinor *hin=(SiteHalfCommSpinor *)in;
precisionChange((vComplexHigh *)&out[o],(vComplexLow *)&hin[o],Nw); precisionChange((vComplexHigh *)&out[o],(vComplexLow *)&hin[o],Nw);
} }