Ejemplo n.º 1
0
  void DiracClover::checkParitySpinor(const cudaColorSpinorField &out, const cudaColorSpinorField &in) const
  {
    Dirac::checkParitySpinor(out, in);

    if (out.Volume() != clover.VolumeCB()) {
      errorQuda("Parity spinor volume %d doesn't match clover checkboard volume %d",
		out.Volume(), clover.VolumeCB());
    }
  }
Ejemplo n.º 2
0
void DiracClover::checkParitySpinor(const cudaColorSpinorField &out, const cudaColorSpinorField &in,
				    const FullClover &clover) const
{
  Dirac::checkParitySpinor(out, in);

  if (out.Volume() != clover.even.volume) {
    errorQuda("Spinor volume %d doesn't match even clover volume %d",
	      out.Volume(), clover.even.volume);
  }
  if (out.Volume() != clover.odd.volume) {
    errorQuda("Spinor volume %d doesn't match odd clover volume %d",
	      out.Volume(), clover.odd.volume);
  }

}
Ejemplo n.º 3
0
  //!NEW : added setFace(),   domainWallDslashCuda() got an extra argument  
  void DiracDomainWall::Dslash(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			       const QudaParity parity) const
  {
    if ( in.Ndim() != 5 || out.Ndim() != 5) errorQuda("Wrong number of dimensions\n");
    checkParitySpinor(in, out);
    checkSpinorAlias(in, out);
 
    domainwall::setFace(face1,face2); // FIXME: temporary hack maintain C linkage for dslashCuda  
    domainWallDslashCuda(&out, gauge, &in, parity, dagger, 0, mass, 0, commDim, profile);   

    long long Ls = in.X(4);
    long long bulk = (Ls-2)*(in.Volume()/Ls);
    long long wall = 2*in.Volume()/Ls;
    flops += 1320LL*(long long)in.Volume() + 96LL*bulk + 120LL*wall;
  }
Ejemplo n.º 4
0
void DiracDomainWall::Dslash(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			     const QudaParity parity) const
{
  if ( in.Ndim() != 5 || out.Ndim() != 5) errorQuda("Wrong number of dimensions\n");
  if (!initDslash) initDslashConstants(gauge, in.Stride());
  if (!initDomainWall) initDomainWallConstants(in.X(4));
  checkParitySpinor(in, out);
  checkSpinorAlias(in, out);
  
  domainWallDslashCuda(&out, gauge, &in, parity, dagger, 0, mass, 0, tuneDslash);

  long long Ls = in.X(4);
  long long bulk = (Ls-2)*(in.Volume()/Ls);
  long long wall = 2*in.Volume()/Ls;
  flops += 1320LL*(long long)in.Volume() + 96LL*bulk + 120LL*wall;
}
Ejemplo n.º 5
0
//!NEW : added setFace(), domainWallDslashCuda() got an extra argument 
void DiracDomainWall::DslashXpay(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
				 const QudaParity parity, const cudaColorSpinorField &x,
				 const double &k) const
{
  if ( in.Ndim() != 5 || out.Ndim() != 5) errorQuda("Wrong number of dimensions\n");
  checkParitySpinor(in, out);
  checkSpinorAlias(in, out);

  initSpinorConstants(in);
  setFace(face); // FIXME: temporary hack maintain C linkage for dslashCuda  
  domainWallDslashCuda(&out, gauge, &in, parity, dagger, &x, mass, k, commDim);

  long long Ls = in.X(4);
  long long bulk = (Ls-2)*(in.Volume()/Ls);
  long long wall = 2*in.Volume()/Ls;
  flops += (1320LL+48LL)*(long long)in.Volume() + 96LL*bulk + 120LL*wall;
}
Ejemplo n.º 6
0
  void DiracStaggered::Dslash(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			      const QudaParity parity) const
  {
    checkParitySpinor(in, out);

    staggered::setFace(face1, face2); // FIXME: temporary hack maintain C linkage for dslashCuda
    staggeredDslashCuda(&out, gauge, &in, parity, dagger, 0, 0, commDim, profile);
  
    flops += 570ll*in.Volume();
  }
Ejemplo n.º 7
0
void DiracStaggered::checkParitySpinor(const cudaColorSpinorField &in, const cudaColorSpinorField &out) const
{
  if (in.Precision() != out.Precision()) {
    errorQuda("Input and output spinor precisions don't match in dslash_quda");
  }

  if (in.Stride() != out.Stride()) {
    errorQuda("Input %d and output %d spinor strides don't match in dslash_quda", in.Stride(), out.Stride());
  }

  if (in.SiteSubset() != QUDA_PARITY_SITE_SUBSET || out.SiteSubset() != QUDA_PARITY_SITE_SUBSET) {
    errorQuda("ColorSpinorFields are not single parity, in = %d, out = %d", 
	      in.SiteSubset(), out.SiteSubset());
  }

  if ((out.Volume() != 2*fatGauge->VolumeCB() && out.SiteSubset() == QUDA_FULL_SITE_SUBSET) ||
      (out.Volume() != fatGauge->VolumeCB() && out.SiteSubset() == QUDA_PARITY_SITE_SUBSET) ) {
    errorQuda("Spinor volume %d doesn't match gauge volume %d", out.Volume(), fatGauge->VolumeCB());
  }
}
Ejemplo n.º 8
0
  void DiracStaggered::DslashXpay(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
				  const QudaParity parity, const cudaColorSpinorField &x,
				  const double &k) const
  {    
    checkParitySpinor(in, out);

    initSpinorConstants(in, profile);
    setFace(face); // FIXME: temporary hack maintain C linkage for dslashCuda
    staggeredDslashCuda(&out, fatGauge, longGauge, &in, parity, dagger, &x, k, commDim, profile);
  
    flops += 1158ll*in.Volume();
  }
Ejemplo n.º 9
0
  // Public method to apply the clover term only
  void DiracClover::Clover(cudaColorSpinorField &out, const cudaColorSpinorField &in, const QudaParity parity) const
  {
    initSpinorConstants(in);
    checkParitySpinor(in, out);

    // regular clover term
    FullClover cs;
    cs.even = clover.even; cs.odd = clover.odd; cs.evenNorm = clover.evenNorm; cs.oddNorm = clover.oddNorm;
    cs.precision = clover.precision; cs.bytes = clover.bytes, cs.norm_bytes = clover.norm_bytes;
    cloverCuda(&out, gauge, cs, &in, parity);

    flops += 504*in.Volume();
  }
Ejemplo n.º 10
0
void DiracWilson::Dslash(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			 const QudaParity parity) const
{
  initSpinorConstants(in);
  checkParitySpinor(in, out);
  checkSpinorAlias(in, out);

  setFace(face); // FIXME: temporary hack maintain C linkage for dslashCuda

  wilsonDslashCuda(&out, gauge, &in, parity, dagger, 0, 0.0, commDim);

  flops += 1320ll*in.Volume();
}
Ejemplo n.º 11
0
void DiracStaggered::Dslash(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			 const QudaParity parity) const
{
  if (!initDslash) {
    initDslashConstants(*fatGauge, in.Stride());
    initStaggeredConstants(*fatGauge, *longGauge);
  }
  checkParitySpinor(in, out);

  setFace(face); // FIXME: temporary hack maintain C linkage for dslashCuda
  staggeredDslashCuda(&out, *fatGauge, *longGauge, &in, parity, dagger, 0, 0, commDim);
  
  flops += 1146*in.Volume();
}
Ejemplo n.º 12
0
// Public method to apply the clover term only
void DiracClover::Clover(cudaColorSpinorField &out, const cudaColorSpinorField &in, const QudaParity parity) const
{
  if (!initDslash) initDslashConstants(gauge, in.Stride());
  if (!initClover) initCloverConstants(clover.Stride());
  checkParitySpinor(in, out, clover);

  // regular clover term
  FullClover cs;
  cs.even = clover.even; cs.odd = clover.odd; cs.evenNorm = clover.evenNorm; cs.oddNorm = clover.oddNorm;
  cs.precision = clover.precision; cs.bytes = clover.bytes, cs.norm_bytes = clover.norm_bytes;
  cloverCuda(&out, gauge, cs, &in, parity, tuneClover);

  flops += 504*in.Volume();
}
Ejemplo n.º 13
0
  void DiracWilson::DslashXpay(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			       const QudaParity parity, const cudaColorSpinorField &x,
			       const double &k) const
  {
    initSpinorConstants(in, profile);
    checkParitySpinor(in, out);
    checkSpinorAlias(in, out);

    setFace(face1,face2); // FIXME: temporary hack maintain C linkage for dslashCuda

    wilsonDslashCuda(&out, gauge, &in, parity, dagger, &x, k, commDim, profile);

    flops += 1368ll*in.Volume();
  }
Ejemplo n.º 14
0
  // Public method
  void DiracCloverPC::CloverInv(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
				const QudaParity parity) const
  {
    initSpinorConstants(in);
    checkParitySpinor(in, out);

    // needs to be cloverinv
    FullClover cs;
    cs.even = clover.evenInv; cs.odd = clover.oddInv; cs.evenNorm = clover.evenInvNorm; cs.oddNorm = clover.oddInvNorm;
    cs.precision = clover.precision; cs.bytes = clover.bytes, cs.norm_bytes = clover.norm_bytes;
    cloverCuda(&out, gauge, cs, &in, parity);

    flops += 504*in.Volume();
  }
Ejemplo n.º 15
0
  // apply hopping term, then clover: (A_ee^-1 D_eo) or (A_oo^-1 D_oe),
  // and likewise for dagger: (A_ee^-1 D^dagger_eo) or (A_oo^-1 D^dagger_oe)
  // NOTE - this isn't Dslash dagger since order should be reversed!
  void DiracCloverPC::Dslash(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			     const QudaParity parity) const
  {
    initSpinorConstants(in);
    checkParitySpinor(in, out);
    checkSpinorAlias(in, out);

    setFace(face); // FIXME: temporary hack maintain C linkage for dslashCuda

    FullClover cs;
    cs.even = clover.evenInv; cs.odd = clover.oddInv; cs.evenNorm = clover.evenInvNorm; cs.oddNorm = clover.oddInvNorm;
    cs.precision = clover.precision; cs.bytes = clover.bytes, cs.norm_bytes = clover.norm_bytes;
    cloverDslashCuda(&out, gauge, cs, &in, parity, dagger, 0, 0.0, commDim);

    flops += (1320+504)*in.Volume();
  }
Ejemplo n.º 16
0
// xpay version of the above
void DiracCloverPC::DslashXpay(cudaColorSpinorField &out, const cudaColorSpinorField &in, 
			       const QudaParity parity, const cudaColorSpinorField &x,
			       const double &k) const
{
  if (!initDslash) initDslashConstants(gauge, in.Stride());
  if (!initClover) initCloverConstants(clover.Stride());
  checkParitySpinor(in, out, clover);
  checkSpinorAlias(in, out);

  setFace(face); // FIXME: temporary hack maintain C linkage for dslashCuda

  FullClover cs;
  cs.even = clover.evenInv; cs.odd = clover.oddInv; cs.evenNorm = clover.evenInvNorm; cs.oddNorm = clover.oddInvNorm;
  cs.precision = clover.precision; cs.bytes = clover.bytes, cs.norm_bytes = clover.norm_bytes;
  cloverDslashCuda(&out, gauge, cs, &in, parity, dagger, &x, k, commDim);

  flops += (1320+504+48)*in.Volume();
}
Ejemplo n.º 17
0
void Dirac::checkParitySpinor(const cudaColorSpinorField &out, const cudaColorSpinorField &in) const
{
  if (in.GammaBasis() != QUDA_UKQCD_GAMMA_BASIS || 
      out.GammaBasis() != QUDA_UKQCD_GAMMA_BASIS) {
    errorQuda("CUDA Dirac operator requires UKQCD basis, out = %d, in = %d", 
	      out.GammaBasis(), in.GammaBasis());
  }

  if (in.Precision() != out.Precision()) {
    errorQuda("Input precision %d and output spinor precision %d don't match in dslash_quda",
	      in.Precision(), out.Precision());
  }

  if (in.Stride() != out.Stride()) {
    errorQuda("Input %d and output %d spinor strides don't match in dslash_quda", 
	      in.Stride(), out.Stride());
  }

  if (in.SiteSubset() != QUDA_PARITY_SITE_SUBSET || out.SiteSubset() != QUDA_PARITY_SITE_SUBSET) {
    errorQuda("ColorSpinorFields are not single parity: in = %d, out = %d", 
	      in.SiteSubset(), out.SiteSubset());
  }

  if (out.Ndim() != 5) {
    if ((out.Volume() != gauge.Volume() && out.SiteSubset() == QUDA_FULL_SITE_SUBSET) ||
	(out.Volume() != gauge.VolumeCB() && out.SiteSubset() == QUDA_PARITY_SITE_SUBSET) ) {
      errorQuda("Spinor volume %d doesn't match gauge volume %d", out.Volume(), gauge.VolumeCB());
    }
  } else {
    // Domain wall fermions, compare 4d volumes not 5d
    if ((out.Volume()/out.X(4) != gauge.Volume() && out.SiteSubset() == QUDA_FULL_SITE_SUBSET) ||
	(out.Volume()/out.X(4) != gauge.VolumeCB() && out.SiteSubset() == QUDA_PARITY_SITE_SUBSET) ) {
      errorQuda("Spinor volume %d doesn't match gauge volume %d", out.Volume(), gauge.VolumeCB());
    }
  }
}