00001
00002
00003
00004
00005
00006 #include "avp_altivecf_solver.h"
00007 #include <dwf-altivecf.h>
00008
00009 namespace Chroma
00010 {
00011
00012
00013
00014
00015
00016
00017 namespace AVPSolver
00018 {
00019
00020 MIT_altivecf_DWF_Fermion* AltiVecDWFSolverF::loadFermionRHS(const void* OuterFermion) const {
00021 return MIT_altivecf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderRHS);
00022 }
00023
00024 MIT_altivecf_DWF_Fermion* AltiVecDWFSolverF::loadFermionGuess(const void *OuterFermion) const {
00025 return MIT_altivecf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderGuess);
00026 }
00027
00028 MIT_altivecf_DWF_Fermion* AltiVecDWFSolverF::allocateFermion(void) const {
00029 return MIT_altivecf_DWF_allocate_fermion();
00030 }
00031
00032 void AltiVecDWFSolverF::saveFermionSolver(void *OuterFermion,
00033 MIT_altivecf_DWF_Fermion* CGFermion) const {
00034 MIT_altivecf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterSolver, CGFermion);
00035 }
00036
00037 void AltiVecDWFSolverF::saveFermionOperator(void *OuterFermion,
00038 MIT_altivecf_DWF_Fermion* CGFermion) const {
00039 MIT_altivecf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterOperator, CGFermion);
00040 }
00041
00042 void AltiVecDWFSolverF::deleteFermion(MIT_altivecf_DWF_Fermion* ptr) const {
00043 MIT_altivecf_DWF_delete_fermion(ptr);
00044 }
00045
00046
00047 int AltiVecDWFSolverF::cgInternal(MIT_altivecf_DWF_Fermion *psi,
00048 double *out_eps,
00049 int *out_iter,
00050 double M,
00051 double m_f,
00052 const MIT_altivecf_DWF_Fermion *x0,
00053 const MIT_altivecf_DWF_Fermion *eta,
00054 double eps,
00055 int min_iter,
00056 int max_iter) const
00057 {
00058 QDPIO::cout << "Entering MIT_altivecf_DWF_cg_solver" << endl;
00059 return MIT_altivecf_DWF_cg_solver(psi, out_eps, out_iter, g, M, m_f,
00060 x0, eta, eps, min_iter, max_iter);
00061 }
00062
00063 void AltiVecDWFSolverF::loadGauge(const void *u,
00064 const void *v) {
00065 g=MIT_altivecf_DWF_load_gauge(u, v, NULL, &AVPSolverFunctions::gaugeReader);
00066 }
00067
00068 void AltiVecDWFSolverF::deleteGauge(void) {
00069 MIT_altivecf_DWF_delete_gauge(g);
00070 }
00071
00072
00073
00074 int AltiVecDWFSolverF::init(const int lattice[5],
00075 void *(*allocator)(size_t size),
00076 void (*deallocator)(void *)) {
00077 return MIT_altivecf_DWF_init(lattice, allocator, deallocator);
00078 }
00079
00080
00081 void AltiVecDWFSolverF::fini(void) {
00082 MIT_altivecf_DWF_fini();
00083 }
00084 }
00085
00086
00087
00088 }
00089
00090