QUDA  v1.1.0
A library for QCD on GPUs
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
quda::Dirac Class Referenceabstract

#include <dirac_quda.h>

+ Inheritance diagram for quda::Dirac:

Public Member Functions

 Dirac (const DiracParam &param)
 
 Dirac (const Dirac &dirac)
 
virtual ~Dirac ()
 
Diracoperator= (const Dirac &dirac)
 
void setCommDim (const int commDim_[QUDA_MAX_DIM]) const
 Enable / disable communications for the Dirac operator. More...
 
virtual bool isCoarse () const
 Whether the Dirac object is the DiracCoarse. More...
 
virtual void checkParitySpinor (const ColorSpinorField &, const ColorSpinorField &) const
 Check parity spinors are usable (check geometry ?) More...
 
virtual void checkFullSpinor (const ColorSpinorField &, const ColorSpinorField &) const
 check full spinors are compatible (check geometry ?) More...
 
void checkSpinorAlias (const ColorSpinorField &, const ColorSpinorField &) const
 check spinors do not alias More...
 
virtual bool hasDslash () const
 Whether or not the operator has a single-parity Dslash. More...
 
virtual void Dslash (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const =0
 apply 'dslash' operator for the DiracOp. This may be e.g. AD More...
 
virtual void DslashXpay (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const =0
 Xpay version of Dslash. More...
 
virtual void M (ColorSpinorField &out, const ColorSpinorField &in) const =0
 Apply M for the dirac op. E.g. the Schur Complement operator. More...
 
virtual void MdagM (ColorSpinorField &out, const ColorSpinorField &in) const =0
 Apply MdagM operator which may be optimized. More...
 
virtual void MdagMLocal (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on each rank. Depending on the number of stencil steps of the fermion type, this may require additional effort to include the terms that hop out of the boundary and then hop back. More...
 
virtual void Dslash4 (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
 Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on each rank. Depending on the number of stencil steps of the fermion type, this may require additional effort to include the terms that hop out of the boundary and then hop back. More...
 
void Mdag (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply Mdag (daggered operator of M. More...
 
void MMdag (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply Normal Operator. More...
 
virtual void prepare (ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const =0
 
virtual void reconstruct (ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const =0
 
virtual void prepareSpecialMG (ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const
 
virtual void reconstructSpecialMG (ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const
 
virtual bool hasSpecialMG () const
 specifies whether or not there's a specialized prepare/reconstruct used before/after transfering to/from the coarse level in MG More...
 
void setMass (double mass)
 
double Kappa () const
 accessor for Kappa (mass parameter) More...
 
virtual double Mass () const
 accessor for Mass (in case of a factor of 2 for staggered) More...
 
virtual double Mu () const
 accessor for twist parameter – overrride can return better value More...
 
virtual double MuFactor () const
 accessor for mu factoo for MG/ – override can return a better value More...
 
unsigned long long Flops () const
 returns and then zeroes flopcount More...
 
QudaMatPCType getMatPCType () const
 returns preconditioning type More...
 
int getStencilSteps () const
 I have no idea what this does. More...
 
void Dagger (QudaDagType dag) const
 sets whether operator is daggered or not More...
 
void flipDagger () const
 Flips value of daggered. More...
 
virtual bool hermitian () const
 is operator hermitian More...
 
virtual QudaDiracType getDiracType () const =0
 returns the Dirac type More...
 
virtual void updateFields (cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
 Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate. These are pointers as opposed to references to support passing in nullptr. More...
 
virtual void createCoarseOp (GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
 Create the coarse operator (virtual parent) More...
 
QudaPrecision HaloPrecision () const
 
void setHaloPrecision (QudaPrecision halo_precision_) const
 
virtual void prefetch (QudaFieldLocation mem_space, qudaStream_t stream=0) const
 If managed memory and prefetch is enabled, prefetch the gauge field and temporary spinors to the CPU or GPU as requested. Overloads may also grab a clover term. More...
 
- Public Member Functions inherited from quda::Object
 Object ()
 
virtual ~Object ()
 

Static Public Member Functions

static Diraccreate (const DiracParam &param)
 Creates a subclass from parameters. More...
 
- Static Public Member Functions inherited from quda::Object
static void * operator new (std::size_t size)
 
static void operator delete (void *p)
 
static void * operator new[] (std::size_t size)
 
static void operator delete[] (void *p)
 

Protected Member Functions

bool newTmp (ColorSpinorField **, const ColorSpinorField &) const
 
void deleteTmp (ColorSpinorField **, const bool &reset) const
 

Protected Attributes

cudaGaugeFieldgauge
 
double kappa
 
double mass
 
int laplace3D
 
QudaMatPCType matpcType
 
QudaDagType dagger
 
unsigned long long flops
 
ColorSpinorFieldtmp1
 
ColorSpinorFieldtmp2
 
QudaDiracType type
 
QudaPrecision halo_precision
 
int commDim [QUDA_MAX_DIM]
 
TimeProfile profile
 

Friends

class DiracMatrix
 
class DiracM
 
class DiracMdagM
 
class DiracMdagMLocal
 
class DiracMMdag
 
class DiracMdag
 
class DiracG5M
 

Detailed Description

Definition at line 133 of file dirac_quda.h.

Constructor & Destructor Documentation

◆ Dirac() [1/2]

quda::Dirac::Dirac ( const DiracParam param)

Definition at line 12 of file dirac.cpp.

◆ Dirac() [2/2]

quda::Dirac::Dirac ( const Dirac dirac)

Definition at line 29 of file dirac.cpp.

◆ ~Dirac()

quda::Dirac::~Dirac ( )
virtual

Definition at line 46 of file dirac.cpp.

Member Function Documentation

◆ checkFullSpinor()

void quda::Dirac::checkFullSpinor ( const ColorSpinorField out,
const ColorSpinorField in 
) const
virtual

check full spinors are compatible (check geometry ?)

Definition at line 138 of file dirac.cpp.

◆ checkParitySpinor()

void quda::Dirac::checkParitySpinor ( const ColorSpinorField out,
const ColorSpinorField in 
) const
virtual

Check parity spinors are usable (check geometry ?)

Reimplemented in quda::DiracImprovedStaggeredKD, quda::DiracImprovedStaggered, quda::DiracStaggeredKD, quda::DiracStaggered, quda::DiracTwistedClover, and quda::DiracClover.

Definition at line 108 of file dirac.cpp.

◆ checkSpinorAlias()

void quda::Dirac::checkSpinorAlias ( const ColorSpinorField a,
const ColorSpinorField b 
) const

check spinors do not alias

Definition at line 146 of file dirac.cpp.

◆ create()

Dirac * quda::Dirac::create ( const DiracParam param)
static

Creates a subclass from parameters.

Definition at line 151 of file dirac.cpp.

◆ createCoarseOp()

virtual void quda::Dirac::createCoarseOp ( GaugeField Y,
GaugeField X,
const Transfer T,
double  kappa,
double  mass = 0.,
double  mu = 0.,
double  mu_factor = 0. 
) const
inlinevirtual

Create the coarse operator (virtual parent)

Parameters
Y[out]Coarse link field
X[out]Coarse clover field
T[in]Transfer operator defining the coarse grid
kappaKappa parameter for the coarse operator
massMass parameter for the coarse operator (gets explicitly built into clover, hard coded to zero for non-staggered ops)
muTM mu parameter for the coarse operator
mu_factormultiplicative factor for the mu parameter

Reimplemented in quda::DiracCloverHasenbuschTwistPC, quda::DiracCloverHasenbuschTwist, quda::DiracCloverPC, quda::DiracClover, quda::DiracWilson, quda::DiracImprovedStaggeredKD, quda::DiracImprovedStaggered, quda::DiracStaggeredKD, quda::DiracStaggered, quda::DiracCoarsePC, quda::DiracCoarse, quda::DiracTwistedCloverPC, quda::DiracTwistedClover, quda::DiracTwistedMassPC, and quda::DiracTwistedMass.

Definition at line 377 of file dirac_quda.h.

◆ Dagger()

void quda::Dirac::Dagger ( QudaDagType  dag) const
inline

sets whether operator is daggered or not

Definition at line 333 of file dirac_quda.h.

◆ deleteTmp()

void quda::Dirac::deleteTmp ( ColorSpinorField **  a,
const bool &  reset 
) const
protected

Definition at line 83 of file dirac.cpp.

◆ Dslash()

virtual void quda::Dirac::Dslash ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity 
) const
pure virtual

◆ Dslash4()

virtual void quda::Dirac::Dslash4 ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity 
) const
inlinevirtual

Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on each rank. Depending on the number of stencil steps of the fermion type, this may require additional effort to include the terms that hop out of the boundary and then hop back.

Reimplemented in quda::DiracMobius, and quda::DiracDomainWall4D.

Definition at line 243 of file dirac_quda.h.

◆ DslashXpay()

virtual void quda::Dirac::DslashXpay ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity,
const ColorSpinorField x,
const double &  k 
) const
pure virtual

◆ flipDagger()

void quda::Dirac::flipDagger ( ) const
inline

Flips value of daggered.

Definition at line 338 of file dirac_quda.h.

◆ Flops()

unsigned long long quda::Dirac::Flops ( ) const
inline

returns and then zeroes flopcount

Definition at line 313 of file dirac_quda.h.

◆ getDiracType()

virtual QudaDiracType quda::Dirac::getDiracType ( ) const
pure virtual

◆ getMatPCType()

QudaMatPCType quda::Dirac::getMatPCType ( ) const
inline

returns preconditioning type

Definition at line 323 of file dirac_quda.h.

◆ getStencilSteps()

int quda::Dirac::getStencilSteps ( ) const

I have no idea what this does.

Definition at line 261 of file dirac.cpp.

◆ HaloPrecision()

QudaPrecision quda::Dirac::HaloPrecision ( ) const
inline

Definition at line 381 of file dirac_quda.h.

◆ hasDslash()

virtual bool quda::Dirac::hasDslash ( ) const
inlinevirtual

Whether or not the operator has a single-parity Dslash.

Reimplemented in quda::DiracImprovedStaggeredKD, and quda::DiracStaggeredKD.

Definition at line 201 of file dirac_quda.h.

◆ hasSpecialMG()

virtual bool quda::Dirac::hasSpecialMG ( ) const
inlinevirtual

specifies whether or not there's a specialized prepare/reconstruct used before/after transfering to/from the coarse level in MG

Returns
whether or not a specialized routine should be used

Reimplemented in quda::DiracImprovedStaggeredKD, and quda::DiracStaggeredKD.

Definition at line 280 of file dirac_quda.h.

◆ hermitian()

virtual bool quda::Dirac::hermitian ( ) const
inlinevirtual

is operator hermitian

Reimplemented in quda::GaugeLaplacePC, quda::GaugeLaplace, quda::DiracImprovedStaggeredPC, and quda::DiracStaggeredPC.

Definition at line 343 of file dirac_quda.h.

◆ isCoarse()

virtual bool quda::Dirac::isCoarse ( ) const
inlinevirtual

Whether the Dirac object is the DiracCoarse.

Reimplemented in quda::DiracCoarse.

Definition at line 181 of file dirac_quda.h.

◆ Kappa()

double quda::Dirac::Kappa ( ) const
inline

accessor for Kappa (mass parameter)

Definition at line 293 of file dirac_quda.h.

◆ M()

virtual void quda::Dirac::M ( ColorSpinorField out,
const ColorSpinorField in 
) const
pure virtual

◆ Mass()

virtual double quda::Dirac::Mass ( ) const
inlinevirtual

accessor for Mass (in case of a factor of 2 for staggered)

Reimplemented in quda::DiracCoarse.

Definition at line 298 of file dirac_quda.h.

◆ Mdag()

void quda::Dirac::Mdag ( ColorSpinorField out,
const ColorSpinorField in 
) const

Apply Mdag (daggered operator of M.

Definition at line 92 of file dirac.cpp.

◆ MdagM()

virtual void quda::Dirac::MdagM ( ColorSpinorField out,
const ColorSpinorField in 
) const
pure virtual

◆ MdagMLocal()

virtual void quda::Dirac::MdagMLocal ( ColorSpinorField out,
const ColorSpinorField in 
) const
inlinevirtual

Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on each rank. Depending on the number of stencil steps of the fermion type, this may require additional effort to include the terms that hop out of the boundary and then hop back.

Reimplemented in quda::DiracMobiusPC.

Definition at line 232 of file dirac_quda.h.

◆ MMdag()

void quda::Dirac::MMdag ( ColorSpinorField out,
const ColorSpinorField in 
) const

Apply Normal Operator.

Definition at line 99 of file dirac.cpp.

◆ Mu()

virtual double quda::Dirac::Mu ( ) const
inlinevirtual

accessor for twist parameter – overrride can return better value

Reimplemented in quda::DiracCoarse, quda::DiracTwistedClover, and quda::DiracTwistedMass.

Definition at line 303 of file dirac_quda.h.

◆ MuFactor()

virtual double quda::Dirac::MuFactor ( ) const
inlinevirtual

accessor for mu factoo for MG/ – override can return a better value

Reimplemented in quda::DiracCoarse.

Definition at line 308 of file dirac_quda.h.

◆ newTmp()

bool quda::Dirac::newTmp ( ColorSpinorField **  tmp,
const ColorSpinorField a 
) const
protected

Definition at line 72 of file dirac.cpp.

◆ operator=()

Dirac & quda::Dirac::operator= ( const Dirac dirac)

Definition at line 51 of file dirac.cpp.

◆ prefetch()

void quda::Dirac::prefetch ( QudaFieldLocation  mem_space,
qudaStream_t  stream = 0 
) const
virtual

If managed memory and prefetch is enabled, prefetch the gauge field and temporary spinors to the CPU or GPU as requested. Overloads may also grab a clover term.

Parameters
[in]mem_spaceMemory space we are prefetching to
[in]streamWhich stream to run the prefetch in (default 0)

Reimplemented in quda::DiracCoarsePC, quda::DiracCoarse, quda::DiracImprovedStaggeredKD, quda::DiracImprovedStaggered, quda::DiracStaggeredKD, quda::DiracTwistedCloverPC, quda::DiracTwistedClover, quda::DiracCloverPC, and quda::DiracClover.

Definition at line 305 of file dirac.cpp.

◆ prepare()

virtual void quda::Dirac::prepare ( ColorSpinorField *&  src,
ColorSpinorField *&  sol,
ColorSpinorField x,
ColorSpinorField b,
const QudaSolutionType  solType 
) const
pure virtual

◆ prepareSpecialMG()

virtual void quda::Dirac::prepareSpecialMG ( ColorSpinorField *&  src,
ColorSpinorField *&  sol,
ColorSpinorField x,
ColorSpinorField b,
const QudaSolutionType  solType 
) const
inlinevirtual

Reimplemented in quda::DiracImprovedStaggeredKD, and quda::DiracStaggeredKD.

Definition at line 264 of file dirac_quda.h.

◆ reconstruct()

virtual void quda::Dirac::reconstruct ( ColorSpinorField x,
const ColorSpinorField b,
const QudaSolutionType  solType 
) const
pure virtual

◆ reconstructSpecialMG()

virtual void quda::Dirac::reconstructSpecialMG ( ColorSpinorField x,
const ColorSpinorField b,
const QudaSolutionType  solType 
) const
inlinevirtual

Reimplemented in quda::DiracImprovedStaggeredKD, and quda::DiracStaggeredKD.

Definition at line 269 of file dirac_quda.h.

◆ setCommDim()

void quda::Dirac::setCommDim ( const int  commDim_[QUDA_MAX_DIM]) const
inline

Enable / disable communications for the Dirac operator.

Parameters
[in]commDim_Array of booleans which determines whether communications are enabled

Definition at line 174 of file dirac_quda.h.

◆ setHaloPrecision()

void quda::Dirac::setHaloPrecision ( QudaPrecision  halo_precision_) const
inline

Definition at line 382 of file dirac_quda.h.

◆ setMass()

void quda::Dirac::setMass ( double  mass)
inline

Definition at line 282 of file dirac_quda.h.

◆ updateFields()

virtual void quda::Dirac::updateFields ( cudaGaugeField gauge_in,
cudaGaugeField fat_gauge_in,
cudaGaugeField long_gauge_in,
cudaCloverField clover_in 
)
inlinevirtual

Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate. These are pointers as opposed to references to support passing in nullptr.

Parameters
gauge_inUpdated gauge field
fat_gauge_inUpdated fat links
long_gauge_inUpdated long links
clover_inUpdated clover field

Reimplemented in quda::DiracCoarse, quda::DiracImprovedStaggeredKD, quda::DiracImprovedStaggered, quda::DiracStaggeredKD, quda::DiracTwistedClover, and quda::DiracClover.

Definition at line 360 of file dirac_quda.h.

Friends And Related Function Documentation

◆ DiracG5M

friend class DiracG5M
friend

Definition at line 141 of file dirac_quda.h.

◆ DiracM

friend class DiracM
friend

Definition at line 136 of file dirac_quda.h.

◆ DiracMatrix

friend class DiracMatrix
friend

Definition at line 135 of file dirac_quda.h.

◆ DiracMdag

friend class DiracMdag
friend

Definition at line 140 of file dirac_quda.h.

◆ DiracMdagM

friend class DiracMdagM
friend

Definition at line 137 of file dirac_quda.h.

◆ DiracMdagMLocal

friend class DiracMdagMLocal
friend

Definition at line 138 of file dirac_quda.h.

◆ DiracMMdag

friend class DiracMMdag
friend

Definition at line 139 of file dirac_quda.h.

Member Data Documentation

◆ commDim

int quda::Dirac::commDim[QUDA_MAX_DIM]
mutableprotected

Definition at line 159 of file dirac_quda.h.

◆ dagger

QudaDagType quda::Dirac::dagger
mutableprotected

Definition at line 149 of file dirac_quda.h.

◆ flops

unsigned long long quda::Dirac::flops
mutableprotected

Definition at line 150 of file dirac_quda.h.

◆ gauge

cudaGaugeField* quda::Dirac::gauge
protected

Definition at line 144 of file dirac_quda.h.

◆ halo_precision

QudaPrecision quda::Dirac::halo_precision
mutableprotected

Definition at line 154 of file dirac_quda.h.

◆ kappa

double quda::Dirac::kappa
protected

Definition at line 145 of file dirac_quda.h.

◆ laplace3D

int quda::Dirac::laplace3D
protected

Definition at line 147 of file dirac_quda.h.

◆ mass

double quda::Dirac::mass
protected

Definition at line 146 of file dirac_quda.h.

◆ matpcType

QudaMatPCType quda::Dirac::matpcType
protected

Definition at line 148 of file dirac_quda.h.

◆ profile

TimeProfile quda::Dirac::profile
mutableprotected

Definition at line 161 of file dirac_quda.h.

◆ tmp1

ColorSpinorField* quda::Dirac::tmp1
mutableprotected

Definition at line 151 of file dirac_quda.h.

◆ tmp2

ColorSpinorField* quda::Dirac::tmp2
mutableprotected

Definition at line 152 of file dirac_quda.h.

◆ type

QudaDiracType quda::Dirac::type
protected

Definition at line 153 of file dirac_quda.h.


The documentation for this class was generated from the following files: