当前位置: 首页>>代码示例>>C++>>正文


C++ cudaColorSpinorField::Ndim方法代码示例

本文整理汇总了C++中cudaColorSpinorField::Ndim方法的典型用法代码示例。如果您正苦于以下问题:C++ cudaColorSpinorField::Ndim方法的具体用法?C++ cudaColorSpinorField::Ndim怎么用?C++ cudaColorSpinorField::Ndim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cudaColorSpinorField的用法示例。


在下文中一共展示了cudaColorSpinorField::Ndim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Dslash

  //!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;
  }
开发者ID:azrael417,项目名称:quda,代码行数:16,代码来源:dirac_domain_wall.cpp

示例2: Dslash

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;
}
开发者ID:alexstrel,项目名称:quda,代码行数:16,代码来源:dirac_domain_wall.cpp

示例3: DslashXpay

//!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;
}
开发者ID:kpetrov,项目名称:quda,代码行数:18,代码来源:dirac_domain_wall.cpp

示例4: M

// Apply the even-odd preconditioned clover-improved Dirac operator
void DiracDomainWallPC::M(cudaColorSpinorField &out, const cudaColorSpinorField &in) const
{
  if ( in.Ndim() != 5 || out.Ndim() != 5) errorQuda("Wrong number of dimensions\n");
  double kappa2 = -kappa5*kappa5;

  bool reset = newTmp(&tmp1, in);

  if (matpcType == QUDA_MATPC_EVEN_EVEN) {
    Dslash(*tmp1, in, QUDA_ODD_PARITY);
    DslashXpay(out, *tmp1, QUDA_EVEN_PARITY, in, kappa2); 
  } else if (matpcType == QUDA_MATPC_ODD_ODD) {
    Dslash(*tmp1, in, QUDA_EVEN_PARITY);
    DslashXpay(out, *tmp1, QUDA_ODD_PARITY, in, kappa2); 
  } else {
    errorQuda("MatPCType %d not valid for DiracDomainWallPC", matpcType);
  }

  deleteTmp(&tmp1, reset);
}
开发者ID:alexstrel,项目名称:quda,代码行数:20,代码来源:dirac_domain_wall.cpp

示例5: checkParitySpinor

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());
    }
  }
}
开发者ID:kpetrov,项目名称:quda,代码行数:36,代码来源:dirac.cpp


注:本文中的cudaColorSpinorField::Ndim方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。