22 namespace LinOpSysSolverQUDACloverEnv
39 Handle<
FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >
state,
60 LinOpSysSolverQUDAClover::qudaInvert(
const CloverTermT<T, U>& clover,
61 const CloverTermT<T, U>& invclov,
65 SystemSolverResults_t ret;
70 #ifdef BUILD_QUDA_DEVIFACE_SPINOR
71 std::vector<QDPCache::ArgKey> ids;
75 #ifndef BUILD_QUDA_DEVIFACE_SPINOR
76 spinorIn =(
void *)&(chi_s.elem(rb[1].start()).elem(0).elem(0).real());
80 ids.push_back(chi_s.getId());
84 #ifndef BUILD_QUDA_DEVIFACE_SPINOR
85 spinorOut =(
void *)&(psi_s.elem(rb[1].start()).elem(0).elem(0).real());
87 ids.push_back(psi_s.getId());
88 auto dev_ptr = GetMemoryPtr(ids);
89 spinorIn = dev_ptr[0];
90 spinorOut = dev_ptr[1];
98 invertQuda(spinorOut, spinorIn, (QudaInvertParam*)&quda_inv_param);
101 QDPIO::cout <<
"QUDA_"<<solver_string<<
"_CLOVER_SOLVER: time="<< quda_inv_param.secs <<
" s" ;
102 QDPIO::cout <<
"\tPerformance="<< quda_inv_param.gflops/quda_inv_param.secs<<
" GFLOPS" ;
103 QDPIO::cout <<
"\tTotal Time (incl. load gauge)=" << swatch1.getTimeInSeconds() <<
" s"<<std::endl;
105 ret.n_count =quda_inv_param.iter;
118 void* spinorIn =(
void *)&(mod_chi.elem(rb[1].start()).elem(0).elem(0).real());
119 void* spinorOut =(
void *)&(psi_s.elem(rb[0].start()).elem(0).elem(0).real());
124 quda_inv_param.dslash_type = QUDA_CLOVER_WILSON_DSLASH;
125 dslashQuda(spinorOut, spinorIn, &quda_inv_param, 0, 0);
130 Handle< FermState<T, Q, Q> > pstate(
new PeriodicFermState<TF,QF,QF>(links_orig));
131 const AnisoParam_t& aniso = invParam.CloverParams.anisoParam;
132 QDPWilsonDslashT<T,Q,Q> qdp_dslash(pstate, aniso);
138 qdp_dslash.apply(
tmp, mod_chi,
PLUS, 0);
139 invclov.apply(psi2,
tmp,
PLUS, 0);
145 QDPIO::cout <<
"CB=0" << std::endl;
146 QDPIO::cout <<
"Dslash Test: || r || = " << sqrt(norm2(
r,rb[0])) << std::endl;
149 QDPIO::cout <<
"CB=1: Should be zero" << std::endl;
150 QDPIO::cout <<
"Dslash Test: || r || = " << sqrt(norm2(
r,rb[1])) << std::endl;
153 const int* tab = rb[0].siteTable().slice();
154 for(
int i=0;
i < rb[0].numSiteTable();
i++) {
156 bool printSite=
false;
158 for(
int spin=0; spin < 4; spin++) {
159 for(
int col=0; col < 3; col++) {
160 if( (fabs(
r.elem(
j).elem(spin).elem(col).real()) > 1.0e-5 )
161 || (fabs(
r.elem(
j).elem(spin).elem(col).imag()) > 1.0e-5 )) {
168 for(
int spin=0; spin < 4; spin++) {
169 for(
int col=0; col < 3; col++) {
170 QDPIO::cout <<
"Site= " <<
j <<
" Spin= "<< spin <<
" Col= " << col <<
" spinor = ( "
171 << psi2.elem(
j).elem(spin).elem(col).real() <<
" , "
172 << psi2.elem(
j).elem(spin).elem(col).imag() <<
" )" << std::endl;
175 QDPIO::cout << std::endl;
Support class for fermion actions and linear operators.
Class for counted reference semantics.
Class for counted reference semantics.
Wilson Dslash linear operator.
static bool registered
Local registration flag.
const std::string name
Name to be used.
bool registerAll()
Register all the factories.
LinOpSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
multi1d< LatticeFermion > r(Ncb)
Periodic ferm state and a creator.
Register linop system solvers that solve M*psi=chi.
Solve a MdagM*psi=chi linear system by BiCGStab.
Factory for solving M*psi=chi where M is not hermitian or pos. def.