1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Hadrons: namespace macro to tackle GCC 5 bug

This commit is contained in:
Antonin Portelli 2016-12-05 14:29:32 +09:00
parent 7a1ac45679
commit 7ae734103e
11 changed files with 252 additions and 237 deletions

View File

@ -39,8 +39,13 @@ namespace Hadrons {\
using Grid::operator<<;
#define END_HADRONS_NAMESPACE }}
#define BEGIN_MODULE_NAMESPACE(name)\
namespace name {\
using Grid::operator<<;
#define END_MODULE_NAMESPACE }
/* the 'using Grid::operator<<;' statement prevents a very nasty compilation
* error with GCC (clang compiles fine without it).
* error with GCC 5 (clang & GCC 6 compile fine without it).
*/
// FIXME: find a way to do that in a more general fashion

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Domain wall quark action *
******************************************************************************/
namespace MAction
{
BEGIN_MODULE_NAMESPACE(MAction)
class DWFPar: Serializable
{
public:
@ -64,7 +64,8 @@ namespace MAction
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(DWF, MAction);

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Wilson quark action *
******************************************************************************/
namespace MAction
{
BEGIN_MODULE_NAMESPACE(MAction)
class WilsonPar: Serializable
{
public:
@ -62,7 +62,8 @@ namespace MAction
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Wilson, MAction);

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Meson *
******************************************************************************/
namespace MContraction
{
BEGIN_MODULE_NAMESPACE(MContraction)
class MesonPar: Serializable
{
public:
@ -68,7 +68,8 @@ namespace MContraction
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Meson, MContraction);

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Load a NERSC configuration *
******************************************************************************/
namespace MGauge
{
BEGIN_MODULE_NAMESPACE(MGauge)
class LoadPar: Serializable
{
public:
@ -61,7 +61,8 @@ namespace MGauge
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Load, MGauge);

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Random gauge *
******************************************************************************/
namespace MGauge
{
BEGIN_MODULE_NAMESPACE(MGauge)
class Random: public Module<NoPar>
{
public:
@ -54,7 +54,8 @@ namespace MGauge
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Random, MGauge);

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Unit gauge *
******************************************************************************/
namespace MGauge
{
BEGIN_MODULE_NAMESPACE(MGauge)
class Unit: public Module<NoPar>
{
public:
@ -54,7 +54,8 @@ namespace MGauge
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Unit, MGauge);

View File

@ -37,8 +37,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Schur red-black preconditioned CG *
******************************************************************************/
namespace MSolver
{
BEGIN_MODULE_NAMESPACE(MSolver)
class RBPrecCGPar: Serializable
{
public:
@ -62,7 +62,8 @@ namespace MSolver
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(RBPrecCG, MSolver);

View File

@ -48,8 +48,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Point *
******************************************************************************/
namespace MSource
{
BEGIN_MODULE_NAMESPACE(MSource)
class PointPar: Serializable
{
public:
@ -72,7 +72,8 @@ namespace MSource
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Point, MSource);

View File

@ -49,8 +49,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Z2 *
******************************************************************************/
namespace MSource
{
BEGIN_MODULE_NAMESPACE(MSource)
class Z2Par: Serializable
{
public:
@ -74,7 +74,8 @@ namespace MSource
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(Z2, MSource);

View File

@ -10,8 +10,8 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* ___FILEBASENAME___ *
******************************************************************************/
namespace ___NAMESPACE___
{
BEGIN_MODULE_NAMESPACE(___NAMESPACE___)
class ___FILEBASENAME___Par: Serializable
{
public:
@ -34,7 +34,8 @@ namespace ___NAMESPACE___
// execution
virtual void execute(void);
};
}
END_MODULE_NAMESPACE
MODULE_REGISTER_NS(___FILEBASENAME___, ___NAMESPACE___);