1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-18 09:45:55 +01:00

Namespace

This commit is contained in:
paboyle 2018-01-14 22:29:18 +00:00
parent ae2a6cfc6e
commit 65669b116e

View File

@ -30,22 +30,18 @@ directory
#ifndef CP_MODULES_H #ifndef CP_MODULES_H
#define CP_MODULES_H #define CP_MODULES_H
NAMESPACE_BEGIN(Grid);
// FIXME Reorganize QCD namespace
namespace Grid {
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Checkpoint module, owns the Checkpointer // Checkpoint module, owns the Checkpointer
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
template <class ImplementationPolicy> template <class ImplementationPolicy>
class CheckPointerModule: public Parametrized<QCD::CheckpointerParameters>, public HMCModuleBase< QCD::BaseHmcCheckpointer<ImplementationPolicy> > { class CheckPointerModule: public Parametrized<CheckpointerParameters>, public HMCModuleBase< BaseHmcCheckpointer<ImplementationPolicy> > {
public: public:
std::unique_ptr<QCD::BaseHmcCheckpointer<ImplementationPolicy> > CheckPointPtr; std::unique_ptr<BaseHmcCheckpointer<ImplementationPolicy> > CheckPointPtr;
typedef QCD::CheckpointerParameters APar; typedef CheckpointerParameters APar;
typedef HMCModuleBase< QCD::BaseHmcCheckpointer<ImplementationPolicy> > Base; typedef HMCModuleBase< BaseHmcCheckpointer<ImplementationPolicy> > Base;
typedef typename Base::Product Product; typedef typename Base::Product Product;
CheckPointerModule(APar Par): Parametrized<APar>(Par) {} CheckPointerModule(APar Par): Parametrized<APar>(Par) {}
@ -67,11 +63,9 @@ class CheckPointerModule: public Parametrized<QCD::CheckpointerParameters>, publ
}; };
template <char const *str, class ImplementationPolicy, class ReaderClass > template <char const *str, class ImplementationPolicy, class ReaderClass >
class HMC_CPModuleFactory class HMC_CPModuleFactory
: public Factory < HMCModuleBase< QCD::BaseHmcCheckpointer<ImplementationPolicy> > , Reader<ReaderClass> > { : public Factory < HMCModuleBase< BaseHmcCheckpointer<ImplementationPolicy> > , Reader<ReaderClass> > {
public: public:
typedef Reader<ReaderClass> TheReader; typedef Reader<ReaderClass> TheReader;
// use SINGLETON FUNCTOR MACRO HERE // use SINGLETON FUNCTOR MACRO HERE
@ -89,12 +83,9 @@ class HMC_CPModuleFactory
} }
}; };
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// Concrete classes // Concrete classes
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
namespace QCD{
template<class ImplementationPolicy> template<class ImplementationPolicy>
class BinaryCPModule: public CheckPointerModule< ImplementationPolicy> { class BinaryCPModule: public CheckPointerModule< ImplementationPolicy> {
@ -138,21 +129,18 @@ class ILDGCPModule: public CheckPointerModule< ImplementationPolicy> {
#endif #endif
}// QCD temporarily here
extern char cp_string[]; extern char cp_string[];
/* /*
// use macros? // use macros?
static Registrar<QCD::BinaryCPModule<QCD::PeriodicGimplR>, HMC_CPModuleFactory<cp_string, QCD::PeriodicGimplR, XmlReader> > __CPBinarymodXMLInit("Binary"); static Registrar<BinaryCPModule<PeriodicGimplR>, HMC_CPModuleFactory<cp_string, PeriodicGimplR, XmlReader> > __CPBinarymodXMLInit("Binary");
static Registrar<QCD::NerscCPModule<QCD::PeriodicGimplR> , HMC_CPModuleFactory<cp_string, QCD::PeriodicGimplR, XmlReader> > __CPNerscmodXMLInit("Nersc"); static Registrar<NerscCPModule<PeriodicGimplR> , HMC_CPModuleFactory<cp_string, PeriodicGimplR, XmlReader> > __CPNerscmodXMLInit("Nersc");
#ifdef HAVE_LIME #ifdef HAVE_LIME
static Registrar<QCD::ILDGCPModule<QCD::PeriodicGimplR> , HMC_CPModuleFactory<cp_string, QCD::PeriodicGimplR, XmlReader> > __CPILDGmodXMLInit("ILDG"); static Registrar<ILDGCPModule<PeriodicGimplR> , HMC_CPModuleFactory<cp_string, PeriodicGimplR, XmlReader> > __CPILDGmodXMLInit("ILDG");
#endif #endif
*/ */
}// Grid NAMESPACE_END(Grid);
#endif //CP_MODULES_H #endif //CP_MODULES_H