mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Merge branch 'master' of https://github.com/paboyle/Grid
Conflicts: lib/Make.inc lib/qcd/hmc/HMC.h tests/Make.inc tests/Test_hmc_WilsonFermionGauge.cc
This commit is contained in:
commit
a1d1dc96d6
@ -3,7 +3,7 @@
|
||||
#
|
||||
# Project Grid package
|
||||
#
|
||||
# Time-stamp: <2015-06-09 15:26:39 neo>
|
||||
# Time-stamp: <2015-07-10 17:46:21 neo>
|
||||
|
||||
AC_PREREQ([2.63])
|
||||
AC_INIT([Grid], [1.0], [paboyle@ph.ed.ac.uk])
|
||||
@ -104,9 +104,9 @@ case ${ac_SIMD} in
|
||||
AC_DEFINE([AVX512],[1],[AVX512 Intrinsics for Knights Corner] )
|
||||
supported="cross compilation"
|
||||
;;
|
||||
NEONv7)
|
||||
echo Configuring for experimental ARMv7 support
|
||||
AC_DEFINE([NEONv7],[1],[NEON ARMv7 Experimental support ] )
|
||||
NEONv8)
|
||||
echo Configuring for experimental ARMv8a support
|
||||
AC_DEFINE([NEONv8],[1],[NEON ARMv8 Experimental support ] )
|
||||
supported="cross compilation"
|
||||
;;
|
||||
DEBUG)
|
||||
|
11
lib/Config.h
11
lib/Config.h
@ -1,5 +1,5 @@
|
||||
/* lib/GridConfig.h. Generated from GridConfig.h.in by configure. */
|
||||
/* lib/GridConfig.h.in. Generated from configure.ac by autoheader. */
|
||||
/* lib/Config.h. Generated from Config.h.in by configure. */
|
||||
/* lib/Config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* AVX Intrinsics */
|
||||
/* #undef AVX1 */
|
||||
@ -34,9 +34,6 @@
|
||||
/* Support AVX2 (Advanced Vector Extensions 2) instructions */
|
||||
/* #undef HAVE_AVX2 */
|
||||
|
||||
/* define if the compiler supports basic C++11 syntax */
|
||||
/* #undef HAVE_CXX11 */
|
||||
|
||||
/* Define to 1 if you have the declaration of `be64toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BE64TOH 1
|
||||
@ -120,8 +117,8 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* NEON ARMv7 Experimental support */
|
||||
/* #undef NEONv7 */
|
||||
/* NEON ARMv8 Experimental support */
|
||||
/* #undef NEONv8 */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "grid"
|
||||
|
@ -116,8 +116,8 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* NEON ARMv7 Experimental support */
|
||||
#undef NEONv7
|
||||
/* NEON ARMv8 Experimental support */
|
||||
#undef NEONv8
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
@ -7,7 +7,7 @@ namespace Grid{
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Wilson Gauge Action .. should I template the Nc etc..
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
template<class GaugeField,class MatrixField>
|
||||
template<class GaugeField, class MatrixField>
|
||||
class WilsonGaugeAction : public Action<GaugeField> {
|
||||
private:
|
||||
RealD beta;
|
||||
@ -25,7 +25,6 @@ namespace Grid{
|
||||
return action;
|
||||
};
|
||||
virtual void deriv(const GaugeField &U,GaugeField & dSdU) {
|
||||
|
||||
//not optimal implementation FIXME
|
||||
//extend Ta to include Lorentz indexes
|
||||
RealD factor = 0.5*beta/RealD(Nc);
|
||||
|
@ -1,15 +1,16 @@
|
||||
//--------------------------------------------------------------------
|
||||
/*! @file HMC.h
|
||||
* @brief Declaration of classes for Hybrid Monte Carlo update
|
||||
* @brief Classes for Hybrid Monte Carlo update
|
||||
*
|
||||
* @author Guido Cossu
|
||||
* Time-stamp: <2015-07-30 16:58:26 neo>
|
||||
*/
|
||||
//--------------------------------------------------------------------
|
||||
#ifndef HMC_INCLUDED
|
||||
#define HMC_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Grid{
|
||||
namespace QCD{
|
||||
@ -20,7 +21,7 @@ namespace Grid{
|
||||
Integer ThermalizationSteps;
|
||||
Integer StartingConfig;
|
||||
Integer SaveInterval; //Setting to 0 does not save configurations
|
||||
std::string Filename_prefix; // To save configurations
|
||||
std::string Filename_prefix; // To save configurations and rng seed
|
||||
|
||||
HMCparameters();
|
||||
};
|
||||
@ -46,8 +47,8 @@ namespace Grid{
|
||||
random(sRNG,rn_test);
|
||||
|
||||
std::cout<<GridLogMessage<< "--------------------------------------------\n";
|
||||
std::cout<<GridLogMessage<< "dH = "<<DeltaH << " Random = "<< rn_test
|
||||
<< "\nAcc. Probability = " << ((prob<1.0)? prob: 1.0)<< " ";
|
||||
std::cout<<GridLogMessage<< "dH = "<<DeltaH << " Random = "<< rn_test <<"\n";
|
||||
std::cout<<GridLogMessage<< "Acc. Probability = " << ((prob<1.0)? prob: 1.0)<< " ";
|
||||
|
||||
if((prob >1.0) || (rn_test <= prob)){ // accepted
|
||||
std::cout<<GridLogMessage <<"-- ACCEPTED\n";
|
||||
@ -62,8 +63,7 @@ namespace Grid{
|
||||
/////////////////////////////////////////////////////////
|
||||
// Evolution
|
||||
/////////////////////////////////////////////////////////
|
||||
RealD evolve_step(LatticeLorentzColourMatrix& U){
|
||||
|
||||
RealD evolve_step(LatticeGaugeField& U){
|
||||
MD.init(U); // set U and initialize P and phi's
|
||||
|
||||
RealD H0 = MD.S(U); // initial state action
|
||||
@ -73,8 +73,6 @@ namespace Grid{
|
||||
|
||||
RealD H1 = MD.S(U); // updated state action
|
||||
std::cout<<GridLogMessage<<"Total H after = "<< H1 << "\n";
|
||||
std::cout<<GridLogMessage<<"DeltaH is "<< H1-H0 << "\n";
|
||||
|
||||
return (H1-H0);
|
||||
}
|
||||
|
||||
@ -89,12 +87,10 @@ namespace Grid{
|
||||
sRNG.SeedRandomDevice();
|
||||
|
||||
}
|
||||
|
||||
~HybridMonteCarlo(){};
|
||||
|
||||
|
||||
void evolve(LatticeLorentzColourMatrix& Uin){
|
||||
|
||||
void evolve(LatticeGaugeField& Uin){
|
||||
Real DeltaH;
|
||||
|
||||
// Thermalizations
|
||||
@ -102,13 +98,13 @@ namespace Grid{
|
||||
std::cout<<GridLogMessage << "-- # Thermalization step = "<< iter << "\n";
|
||||
|
||||
DeltaH = evolve_step(Uin);
|
||||
std::cout<<GridLogMessage<< " dH = "<< DeltaH << "\n";
|
||||
std::cout<<GridLogMessage<< "dH = "<< DeltaH << "\n";
|
||||
}
|
||||
|
||||
// Actual updates (evolve a copy Ucopy then copy back eventually)
|
||||
LatticeLorentzColourMatrix Ucopy(Uin._grid);
|
||||
for(int iter=Params.StartingConfig; iter < Params.Nsweeps+Params.StartingConfig; ++iter){
|
||||
|
||||
LatticeGaugeField Ucopy(Uin._grid);
|
||||
for(int iter=Params.StartingConfig;
|
||||
iter < Params.Nsweeps+Params.StartingConfig; ++iter){
|
||||
std::cout<<GridLogMessage << "-- # Sweep = "<< iter << "\n";
|
||||
|
||||
Ucopy = Uin;
|
||||
@ -117,8 +113,6 @@ namespace Grid{
|
||||
|
||||
if(metropolis_test(DeltaH)) Uin = Ucopy;
|
||||
|
||||
//need sync? // Query Guido on this comment
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,8 +1,9 @@
|
||||
//--------------------------------------------------------------------
|
||||
/*! @file Integrator.h
|
||||
* @brief Declaration of classes for the Molecular Dynamics integrator
|
||||
* @brief Classes for the Molecular Dynamics integrator
|
||||
*
|
||||
* @author Guido Cossu
|
||||
* Time-stamp: <2015-07-30 16:21:29 neo>
|
||||
*/
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@ -16,8 +17,16 @@ class Observer;
|
||||
namespace Grid{
|
||||
namespace QCD{
|
||||
|
||||
typedef Action<LatticeLorentzColourMatrix>* ActPtr; // now force the same colours as the rest of the code
|
||||
typedef std::vector<ActPtr> ActionLevel;
|
||||
typedef Action<LatticeGaugeField>* ActPtr; // now force the same colours as the rest of the code
|
||||
struct ActionLevel{
|
||||
int multiplier;
|
||||
public:
|
||||
std::vector<ActPtr> actions;
|
||||
explicit ActionLevel(int mul = 1):multiplier(mul){assert (mul > 0);};
|
||||
void push_back(ActPtr ptr){
|
||||
actions.push_back(ptr);
|
||||
}
|
||||
};
|
||||
typedef std::vector<ActionLevel> ActionSet;
|
||||
typedef std::vector<Observer*> ObserverList;
|
||||
|
||||
@ -35,8 +44,8 @@ namespace Grid{
|
||||
|
||||
|
||||
namespace MDutils{
|
||||
void generate_momenta(LatticeLorentzColourMatrix&,GridParallelRNG&);
|
||||
void generate_momenta_su3(LatticeLorentzColourMatrix&,GridParallelRNG&);
|
||||
void generate_momenta(LatticeGaugeField&,GridParallelRNG&);
|
||||
void generate_momenta_su3(LatticeGaugeField&,GridParallelRNG&);
|
||||
}
|
||||
|
||||
/*! @brief Class for Molecular Dynamics management */
|
||||
@ -45,8 +54,7 @@ namespace Grid{
|
||||
private:
|
||||
IntegratorParameters Params;
|
||||
const ActionSet as;
|
||||
const std::vector<int> Nrel; //relative step size per level
|
||||
std::unique_ptr<LatticeLorentzColourMatrix> P;
|
||||
std::unique_ptr<LatticeGaugeField> P;
|
||||
GridParallelRNG pRNG;
|
||||
//ObserverList observers; // not yet
|
||||
|
||||
@ -55,15 +63,15 @@ namespace Grid{
|
||||
void register_observers();
|
||||
void notify_observers();
|
||||
|
||||
void update_P(LatticeLorentzColourMatrix&U, int level,double ep){
|
||||
for(int a=0; a<as[level].size(); ++a){
|
||||
LatticeLorentzColourMatrix force(U._grid);
|
||||
as[level].at(a)->deriv(U,force);
|
||||
void update_P(LatticeGaugeField&U, int level,double ep){
|
||||
for(int a=0; a<as[level].actions.size(); ++a){
|
||||
LatticeGaugeField force(U._grid);
|
||||
as[level].actions.at(a)->deriv(U,force);
|
||||
*P -= force*ep;
|
||||
}
|
||||
}
|
||||
|
||||
void update_U(LatticeLorentzColourMatrix&U, double ep){
|
||||
void update_U(LatticeGaugeField&U, double ep){
|
||||
//rewrite exponential to deal automatically with the lorentz index?
|
||||
LatticeColourMatrix Umu(U._grid);
|
||||
LatticeColourMatrix Pmu(U._grid);
|
||||
@ -77,34 +85,31 @@ namespace Grid{
|
||||
}
|
||||
|
||||
|
||||
friend void IntegratorAlgorithm::step (LatticeLorentzColourMatrix& U,
|
||||
friend void IntegratorAlgorithm::step (LatticeGaugeField& U,
|
||||
int level, std::vector<int>& clock,
|
||||
Integrator<IntegratorAlgorithm>* Integ);
|
||||
public:
|
||||
Integrator(GridBase* grid, IntegratorParameters Par,
|
||||
ActionSet& Aset, std::vector<int> Nrel_):
|
||||
Params(Par),as(Aset),Nrel(Nrel_),P(new LatticeLorentzColourMatrix(grid)),pRNG(grid){
|
||||
assert(as.size() == Nrel.size());
|
||||
ActionSet& Aset):
|
||||
Params(Par),as(Aset),P(new LatticeGaugeField(grid)),pRNG(grid){
|
||||
pRNG.SeedRandomDevice();
|
||||
};
|
||||
|
||||
~Integrator(){}
|
||||
|
||||
//Initialization of momenta and actions
|
||||
void init(LatticeLorentzColourMatrix& U){
|
||||
|
||||
void init(LatticeGaugeField& U){
|
||||
std::cout<<GridLogMessage<< "Integrator init\n";
|
||||
|
||||
MDutils::generate_momenta(*P,pRNG);
|
||||
for(int level=0; level< as.size(); ++level){
|
||||
for(int actionID=0; actionID<as.at(level).size(); ++actionID){
|
||||
as[level].at(actionID)->init(U, pRNG);
|
||||
for(int actionID=0; actionID<as[level].actions.size(); ++actionID){
|
||||
as[level].actions.at(actionID)->init(U, pRNG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate action
|
||||
RealD S(LatticeLorentzColourMatrix& U){
|
||||
RealD S(LatticeGaugeField& U){
|
||||
LatticeComplex Hloc(U._grid);
|
||||
Hloc = zero;
|
||||
// Momenta
|
||||
@ -120,15 +125,15 @@ namespace Grid{
|
||||
|
||||
// Actions
|
||||
for(int level=0; level<as.size(); ++level)
|
||||
for(int actionID=0; actionID<as.at(level).size(); ++actionID)
|
||||
H += as[level].at(actionID)->S(U);
|
||||
for(int actionID=0; actionID<as[level].actions.size(); ++actionID)
|
||||
H += as[level].actions.at(actionID)->S(U);
|
||||
|
||||
std::cout<<GridLogMessage << "Total action H = "<< H << "\n";
|
||||
|
||||
return H;
|
||||
}
|
||||
|
||||
void integrate(LatticeLorentzColourMatrix& U){
|
||||
void integrate(LatticeGaugeField& U){
|
||||
std::vector<int> clock;
|
||||
clock.resize(as.size(),0);
|
||||
for(int step=0; step< Params.MDsteps; ++step) // MD step
|
||||
|
@ -27,14 +27,13 @@ namespace Grid{
|
||||
int fl = Integ->as.size() -1;
|
||||
double eps = Integ->Params.stepsize;
|
||||
|
||||
for(int l=0; l<=level; ++l) eps/= 2.0*Integ->Nrel[l];
|
||||
for(int l=0; l<=level; ++l) eps/= 2.0*Integ->as[l].multiplier;
|
||||
|
||||
int fin = Integ->Nrel[0];
|
||||
for(int l=1; l<=level; ++l) fin*= 2.0*Integ->Nrel[l];
|
||||
int fin = Integ->as[0].multiplier;
|
||||
for(int l=1; l<=level; ++l) fin*= 2.0*Integ->as[l].multiplier;
|
||||
fin = 3*Integ->Params.MDsteps*fin -1;
|
||||
|
||||
for(int e=0; e<Integ->Nrel[level]; ++e){
|
||||
|
||||
|
||||
for(int e=0; e<Integ->as[level].multiplier; ++e){
|
||||
if(clock[level] == 0){ // initial half step
|
||||
Integ->update_P(U,level,lambda*eps);
|
||||
++clock[level];
|
||||
@ -98,13 +97,13 @@ namespace Grid{
|
||||
double eps = Integ->Params.stepsize;
|
||||
|
||||
// Get current level step size
|
||||
for(int l=0; l<=level; ++l) eps/= Integ->Nrel[l];
|
||||
for(int l=0; l<=level; ++l) eps/= Integ->as[l].multiplier;
|
||||
|
||||
int fin = 1;
|
||||
for(int l=0; l<=level; ++l) fin*= Integ->Nrel[l];
|
||||
for(int l=0; l<=level; ++l) fin*= Integ->as[l].multiplier;
|
||||
fin = 2*Integ->Params.MDsteps*fin - 1;
|
||||
|
||||
for(int e=0; e<Integ->Nrel[level]; ++e){
|
||||
for(int e=0; e<Integ->as[level].multiplier; ++e){
|
||||
|
||||
if(clock[level] == 0){ // initial half step
|
||||
Integ->update_P(U, level,eps/2.0);
|
||||
|
@ -7,7 +7,6 @@ namespace QCD {
|
||||
template<class GaugeMat,class GaugeLorentz>
|
||||
class WilsonLoops {
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// directed plaquette oriented in mu,nu plane
|
||||
//////////////////////////////////////////////////
|
||||
|
@ -1,14 +1,16 @@
|
||||
//----------------------------------------------------------------------
|
||||
/*! @file Grid_sse4.h
|
||||
@brief Optimization libraries for NEON (ARM) instructions set ARMv7
|
||||
@brief Optimization libraries for NEON (ARM) instructions set ARMv8
|
||||
|
||||
Experimental - Using intrinsics - DEVELOPING!
|
||||
*/
|
||||
// Time-stamp: <2015-06-09 15:25:40 neo>
|
||||
// Time-stamp: <2015-07-10 17:45:09 neo>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
// ARMv8 supports double precision
|
||||
|
||||
namespace Optimization {
|
||||
|
||||
template<class vtype>
|
||||
@ -22,50 +24,47 @@ namespace Optimization {
|
||||
float f[4];
|
||||
};
|
||||
union u128d {
|
||||
float32x4_t v;
|
||||
float f[4];
|
||||
float64x2_t v;
|
||||
double f[4];
|
||||
};
|
||||
|
||||
struct Vsplat{
|
||||
//Complex float
|
||||
inline float32x4_t operator()(float a, float b){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
float tmp[4]={a,b,a,b};
|
||||
return vld1q_f32(tmp);
|
||||
}
|
||||
// Real float
|
||||
inline float32x4_t operator()(float a){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
return vld1q_dup_f32(&a);
|
||||
}
|
||||
//Complex double
|
||||
inline float32x4_t operator()(double a, double b){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
float tmp[4]={(float)a,(float)b,(float)a,(float)b};
|
||||
return vld1q_f32(tmp);
|
||||
}
|
||||
//Real double
|
||||
inline float32x4_t operator()(double a){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
return vld1q_dup_f32(&a);
|
||||
}
|
||||
//Integer
|
||||
inline uint32x4_t operator()(Integer a){
|
||||
uint32x4_t foo;
|
||||
return foo;
|
||||
return vld1q_dup_u32(&a);
|
||||
}
|
||||
};
|
||||
|
||||
struct Vstore{
|
||||
//Float
|
||||
inline void operator()(float32x4_t a, float* F){
|
||||
|
||||
vst1q_f32(F, a);
|
||||
}
|
||||
//Double
|
||||
inline void operator()(float32x4_t a, double* D){
|
||||
|
||||
vst1q_f32((float*)D, a);
|
||||
}
|
||||
//Integer
|
||||
inline void operator()(uint32x4_t a, Integer* I){
|
||||
|
||||
vst1q_u32(I, a);
|
||||
}
|
||||
|
||||
};
|
||||
@ -130,36 +129,30 @@ namespace Optimization {
|
||||
struct Sum{
|
||||
//Complex/Real float
|
||||
inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
return vaddq_f32(a,b);
|
||||
}
|
||||
//Complex/Real double
|
||||
//inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
// float32x4_t foo;
|
||||
// return foo;
|
||||
//}
|
||||
inline float64x2_t operator()(float64x2_t a, float64x2_t b){
|
||||
return vaddq_f64(a,b);
|
||||
}
|
||||
//Integer
|
||||
inline uint32x4_t operator()(uint32x4_t a, uint32x4_t b){
|
||||
uint32x4_t foo;
|
||||
return foo;
|
||||
return vaddq_u32(a,b);
|
||||
}
|
||||
};
|
||||
|
||||
struct Sub{
|
||||
//Complex/Real float
|
||||
inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
return vsubq_f32(a,b);
|
||||
}
|
||||
//Complex/Real double
|
||||
//inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
// float32x4_t foo;
|
||||
// return foo;
|
||||
//}
|
||||
inline float64x2_t operator()(float64x2_t a, float64x2_t b){
|
||||
return vsubq_f64(a,b);
|
||||
}
|
||||
//Integer
|
||||
inline uint32x4_t operator()(uint32x4_t a, uint32x4_t b){
|
||||
uint32x4_t foo;
|
||||
return foo;
|
||||
return vsubq_u32(a,b);
|
||||
}
|
||||
};
|
||||
|
||||
@ -170,24 +163,24 @@ namespace Optimization {
|
||||
return foo;
|
||||
}
|
||||
// Complex double
|
||||
//inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
// float32x4_t foo;
|
||||
// return foo;
|
||||
//}
|
||||
inline float64x2_t operator()(float64x2_t a, float64x2_t b){
|
||||
float32x4_t foo;
|
||||
return foo;
|
||||
}
|
||||
};
|
||||
|
||||
struct Mult{
|
||||
// Real float
|
||||
inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
return a;
|
||||
return vmulq_f32(a,b);
|
||||
}
|
||||
// Real double
|
||||
//inline float32x4_t operator()(float32x4_t a, float32x4_t b){
|
||||
// return 0;
|
||||
//}
|
||||
inline float64x2_t operator()(float64x2_t a, float64x2_t b){
|
||||
return vmulq_f64(a,b);
|
||||
}
|
||||
// Integer
|
||||
inline uint32x4_t operator()(uint32x4_t a, uint32x4_t b){
|
||||
return a;
|
||||
return vmulq_u32(a,b);
|
||||
}
|
||||
};
|
||||
|
||||
@ -219,6 +212,7 @@ namespace Optimization {
|
||||
struct TimesI{
|
||||
//Complex single
|
||||
inline float32x4_t operator()(float32x4_t in, float32x4_t ret){
|
||||
//need shuffle
|
||||
return in;
|
||||
}
|
||||
//Complex double
|
||||
@ -242,20 +236,25 @@ namespace Optimization {
|
||||
//Real float Reduce
|
||||
template<>
|
||||
inline Grid::RealF Reduce<Grid::RealF, float32x4_t>::operator()(float32x4_t in){
|
||||
return 0;
|
||||
float32x2_t high = vget_high_f32(in);
|
||||
float32x2_t low = vget_low_f32(in);
|
||||
float32x2_t tmp = vadd_f32(low, high);
|
||||
float32x2_t sum = vpadd_f32(tmp, tmp);
|
||||
return vget_lane_f32(sum,0);
|
||||
}
|
||||
|
||||
|
||||
//Complex double Reduce
|
||||
template<>
|
||||
inline Grid::ComplexD Reduce<Grid::ComplexD, float32x4_t>::operator()(float32x4_t in){
|
||||
inline Grid::ComplexD Reduce<Grid::ComplexD, float64x2_t>::operator()(float64x2_t in){
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Real double Reduce
|
||||
template<>
|
||||
inline Grid::RealD Reduce<Grid::RealD, float32x4_t>::operator()(float32x4_t in){
|
||||
return 0;
|
||||
inline Grid::RealD Reduce<Grid::RealD, float64x2_t>::operator()(float64x2_t in){
|
||||
float64x2_t sum = vpaddq_f64(in, in);
|
||||
return vgetq_lane_f64(sum,0);
|
||||
}
|
||||
|
||||
//Integer Reduce
|
||||
@ -272,7 +271,7 @@ namespace Optimization {
|
||||
namespace Grid {
|
||||
|
||||
typedef float32x4_t SIMD_Ftype; // Single precision type
|
||||
typedef float32x4_t SIMD_Dtype; // Double precision type - no double on ARMv7
|
||||
typedef float64x2_t SIMD_Dtype; // Double precision type
|
||||
typedef uint32x4_t SIMD_Itype; // Integer type
|
||||
|
||||
inline void v_prefetch0(int size, const char *ptr){}; // prefetch utilities
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*! @file Grid_vector_types.h
|
||||
@brief Defines templated class Grid_simd to deal with inner vector types
|
||||
*/
|
||||
// Time-stamp: <2015-06-09 15:00:47 neo>
|
||||
// Time-stamp: <2015-07-10 17:45:33 neo>
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef GRID_VECTOR_TYPES
|
||||
#define GRID_VECTOR_TYPES
|
||||
@ -22,7 +22,7 @@
|
||||
#if defined QPX
|
||||
#include "Grid_qpx.h"
|
||||
#endif
|
||||
#ifdef NEONv7
|
||||
#ifdef NEONv8
|
||||
#include "Grid_neon.h"
|
||||
#endif
|
||||
|
||||
|
@ -1 +1 @@
|
||||
timestamp for lib/GridConfig.h
|
||||
timestamp for lib/Config.h
|
||||
|
3
scripts/arm_configure.experimental_cortex57
Normal file
3
scripts/arm_configure.experimental_cortex57
Normal file
@ -0,0 +1,3 @@
|
||||
#./configure --host=arm-linux-gnueabihf CXX=clang++-3.5 CXXFLAGS='-std=c++11 -O3 -target arm-linux-gnueabihf -I/usr/arm-linux-gnueabihf/include/ -I/home/neo/Codes/gmp6.0/gmp-arm/include/ -I/usr/lib/llvm-3.5/lib/clang/3.5.0/include/ -L/home/neo/Codes/gmp6.0/gmp-arm/lib/ -I/home/neo/Codes/mpfr3.1.2/mpfr-arm/include/ -L/home/neo/Codes/mpfr3.1.2/mpfr-arm/lib/ -static -mcpu=cortex-a57' --enable-simd=NEONv7
|
||||
|
||||
./configure --host=aarch64-linux-gnu CXX=clang++-3.5 CXXFLAGS='-std=c++11 -O3 -target aarch64-linux-gnu -static -I/home/neo/Codes/gmp6.0/gmp-armv8/include/ -L/home/neo/Codes/gmp6.0/gmp-armv8/lib/ -I/home/neo/Codes/mpfr3.1.2/mpfr-armv8/include/ -L/home/neo/Codes/mpfr3.1.2/mpfr-armv8/lib/ -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/4.8.2/aarch64-linux-gnu/' --enable-simd=NEONv7
|
@ -31,15 +31,16 @@ int main (int argc, char ** argv)
|
||||
ConjugateGradient<LatticeFermion> CGmd(1.0e-6,10000);
|
||||
|
||||
TwoFlavourPseudoFermionAction<LatticeLorentzColourMatrix, LatticeColourMatrix,LatticeFermion>
|
||||
Pseudofermion(FermOp,CGmd,CG,Fine);
|
||||
|
||||
WilsonNf2(FermOp,CG,CG,Fine);
|
||||
|
||||
//Collect actions
|
||||
ActionLevel Level1;
|
||||
Level1.push_back(&Waction);
|
||||
Level1.push_back(&Pseudofermion);
|
||||
Level1.push_back(&WilsonNf2);
|
||||
ActionLevel Level2(3);
|
||||
Level2.push_back(&Waction);
|
||||
ActionSet FullSet;
|
||||
FullSet.push_back(Level1);
|
||||
FullSet.push_back(Level2);
|
||||
|
||||
// Create integrator
|
||||
typedef MinimumNorm2 IntegratorAlgorithm;// change here to change the algorithm
|
||||
|
@ -24,13 +24,13 @@ int main (int argc, char ** argv)
|
||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||
GridParallelRNG pRNG(&Fine);
|
||||
pRNG.SeedRandomDevice();
|
||||
LatticeLorentzColourMatrix U(&Fine);
|
||||
LatticeGaugeField U(&Fine);
|
||||
|
||||
SU3::HotConfiguration(pRNG, U);
|
||||
|
||||
|
||||
// simplify template declaration? Strip the lorentz from the second template
|
||||
WilsonGaugeAction<LatticeLorentzColourMatrix, LatticeColourMatrix> Waction(6.0);
|
||||
WilsonGaugeAction<LatticeGaugeField, LatticeColourMatrix> Waction(6.0);
|
||||
|
||||
//Collect actions
|
||||
ActionLevel Level1;
|
||||
@ -39,10 +39,9 @@ int main (int argc, char ** argv)
|
||||
FullSet.push_back(Level1);
|
||||
|
||||
// Create integrator
|
||||
typedef MinimumNorm2 IntegratorAlgorithm;// change here to change the algorithm
|
||||
typedef MinimumNorm2 IntegratorAlgorithm;// change here to modify the algorithm
|
||||
IntegratorParameters MDpar(12,5,1.0);
|
||||
std::vector<int> rel ={1};
|
||||
Integrator<IntegratorAlgorithm> MDynamics(&Fine,MDpar, FullSet,rel);
|
||||
Integrator<IntegratorAlgorithm> MDynamics(&Fine,MDpar, FullSet);
|
||||
|
||||
// Create HMC
|
||||
HMCparameters HMCpar;
|
||||
|
@ -194,9 +194,34 @@ int main (int argc, char ** argv)
|
||||
// Insist that operations on random scalars gives
|
||||
// identical results to on vectors.
|
||||
|
||||
std::cout<<GridLogMessage << "==================================="<< std::endl;
|
||||
std::cout<<GridLogMessage << "Testing vComplexF "<<std::endl;
|
||||
std::cout<<GridLogMessage << "==================================="<< std::endl;
|
||||
std::cout << GridLogMessage <<"==================================="<< std::endl;
|
||||
std::cout << GridLogMessage <<"Testing vRealF "<<std::endl;
|
||||
std::cout << GridLogMessage <<"==================================="<< std::endl;
|
||||
|
||||
|
||||
Tester<RealF,vRealF>(funcPlus());
|
||||
Tester<RealF,vRealF>(funcMinus());
|
||||
Tester<RealF,vRealF>(funcTimes());
|
||||
Tester<RealF,vRealF>(funcAdj());
|
||||
Tester<RealF,vRealF>(funcConj());
|
||||
Tester<RealF,vRealF>(funcInnerProduct());
|
||||
ReductionTester<RealF,RealF,vRealF>(funcReduce());
|
||||
|
||||
std::cout << GridLogMessage <<"==================================="<< std::endl;
|
||||
std::cout << GridLogMessage <<"Testing vRealD "<<std::endl;
|
||||
std::cout << GridLogMessage <<"==================================="<< std::endl;
|
||||
|
||||
Tester<RealD,vRealD>(funcPlus());
|
||||
Tester<RealD,vRealD>(funcMinus());
|
||||
Tester<RealD,vRealD>(funcTimes());
|
||||
Tester<RealD,vRealD>(funcAdj());
|
||||
Tester<RealD,vRealD>(funcConj());
|
||||
Tester<RealD,vRealD>(funcInnerProduct());
|
||||
ReductionTester<RealD,RealD,vRealD>(funcReduce());
|
||||
|
||||
std::cout << GridLogMessage <<"==================================="<< std::endl;
|
||||
std::cout << GridLogMessage <<"Testing vComplexF "<<std::endl;
|
||||
std::cout << GridLogMessage <<"==================================="<< std::endl;
|
||||
|
||||
Tester<ComplexF,vComplexF>(funcTimesI());
|
||||
Tester<ComplexF,vComplexF>(funcTimesMinusI());
|
||||
@ -223,30 +248,5 @@ int main (int argc, char ** argv)
|
||||
Tester<ComplexD,vComplexD>(funcInnerProduct());
|
||||
ReductionTester<ComplexD,ComplexD,vComplexD>(funcReduce());
|
||||
|
||||
std::cout<<GridLogMessage << "==================================="<< std::endl;
|
||||
std::cout<<GridLogMessage << "Testing vRealF "<<std::endl;
|
||||
std::cout<<GridLogMessage << "==================================="<< std::endl;
|
||||
|
||||
|
||||
Tester<RealF,vRealF>(funcPlus());
|
||||
Tester<RealF,vRealF>(funcMinus());
|
||||
Tester<RealF,vRealF>(funcTimes());
|
||||
Tester<RealF,vRealF>(funcAdj());
|
||||
Tester<RealF,vRealF>(funcConj());
|
||||
Tester<RealF,vRealF>(funcInnerProduct());
|
||||
ReductionTester<RealF,RealF,vRealF>(funcReduce());
|
||||
|
||||
std::cout<<GridLogMessage << "==================================="<< std::endl;
|
||||
std::cout<<GridLogMessage << "Testing vRealD "<<std::endl;
|
||||
std::cout<<GridLogMessage << "==================================="<< std::endl;
|
||||
|
||||
Tester<RealD,vRealD>(funcPlus());
|
||||
Tester<RealD,vRealD>(funcMinus());
|
||||
Tester<RealD,vRealD>(funcTimes());
|
||||
Tester<RealD,vRealD>(funcAdj());
|
||||
Tester<RealD,vRealD>(funcConj());
|
||||
Tester<RealD,vRealD>(funcInnerProduct());
|
||||
ReductionTester<RealD,RealD,vRealD>(funcReduce());
|
||||
|
||||
Grid_finalize();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user