Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all include statements outside of namespaces #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/qdp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/* Include the stuff generated by autoconf */
#include "qdp_config_internal.h"

namespace QDP {

/* Prefix everything with QDP_ */
static const char* const QDP_PACKAGE(PACKAGE);
static const char* const QDP_PACKAGE_BUGREPORT(PACKAGE_BUGREPORT);
Expand All @@ -23,6 +25,8 @@ static const char* const QDP_PACKAGE_TARNAME(PACKAGE_TARNAME);
static const char* const QDP_PACKAGE_VERSION(PACKAGE_VERSION);
static const char* const QDP_VERSION(VERSION);

} // namespace QDP


/* Undef the unwanted */
#undef PACKAGE
Expand Down
5 changes: 2 additions & 3 deletions include/qdp_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#ifndef QDP_PARAMS_H
#define QDP_PARAMS_H

namespace QDP {
#include <qdp_config.h>

namespace QDP {

/*! @defgroup params Fundamental parameters for QDP
*
Expand All @@ -19,8 +20,6 @@ namespace QDP {
* @{
*/

#include <qdp_config.h>

const int Nd = QDP_ND;
const int Nc = QDP_NC;
const int Ns = QDP_NS;
Expand Down
4 changes: 3 additions & 1 deletion include/qdp_parscalar_specific.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,12 @@ void evaluate_userfunc(int lo, int hi, int myId, user_arg<T,T1,Op,RHS> *a)
}
}

} // namespace QDP

//! include the header file for dispatch
#include "qdp_dispatch.h"


namespace QDP {

//-----------------------------------------------------------------------------
//! OLattice Op Scalar(Expression(source)) under an Subset
Expand Down
4 changes: 4 additions & 0 deletions include/qdp_precision.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// Fix Definitions
#include <qdp_config.h>

namespace QDP {

// Fix default precision
#if ! defined(BASE_PRECISION)
#define BASE_PRECISION 32
Expand All @@ -35,6 +37,8 @@ typedef REAL64 DOUBLE;
typedef REAL64 REAL;
typedef REAL64 DOUBLE;

} // namespace QDP

#define INNER_LOG 1

#else
Expand Down
4 changes: 4 additions & 0 deletions include/qdp_scalar_specific.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,13 @@ void evaluate_userfunc(int lo, int hi, int myId, user_arg<T,T1,Op,RHS> *a)
}
}

} // namespace QDP

//! include the header file for dispatch
#include "qdp_dispatch.h"

namespace QDP {

//-----------------------------------------------------------------------------
//! OLattice Op Scalar(Expression(source)) under an Subset
/*!
Expand Down
6 changes: 3 additions & 3 deletions include/qdp_scalarsite_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#ifndef QDP_SCALARSITE_DEFS_H
#define QDP_SCALARSITE_DEFS_H

#include <qdp_config.h>
#include "qdp_precision.h"

namespace QDP {

/*! \addtogroup defs Type definitions
Expand All @@ -18,9 +21,6 @@ namespace QDP {
* @{
*/

#include <qdp_config.h>
#include "qdp_precision.h"

//----------------------------------------------------------------------
//! Gamma matrices are conveniently defined for this Ns
typedef GammaType<Ns> Gamma;
Expand Down
19 changes: 9 additions & 10 deletions include/qdp_scalarsite_pabasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

#warning "Using PABASM Scalarsite"

#include "scalarsite_generic/generic_mult_nn.h"
#include "scalarsite_generic/generic_mult_na.h"
#include "scalarsite_generic/generic_mult_an.h"
#include "scalarsite_generic/generic_mult_aa.h"
#include "scalarsite_generic/generic_mat_vec.h"
#include "scalarsite_generic/generic_adj_mat_vec.h"
#include "scalarsite_generic/generic_addvec.h"


namespace QDP {

/*! @defgroup optimizations Optimizations
Expand All @@ -23,16 +32,6 @@ namespace QDP {
// Use this def just to safe some typing later on in the file
#define RComplexFloat RComplex<float>


#include "scalarsite_generic/generic_mult_nn.h"
#include "scalarsite_generic/generic_mult_na.h"
#include "scalarsite_generic/generic_mult_an.h"
#include "scalarsite_generic/generic_mult_aa.h"
#include "scalarsite_generic/generic_mat_vec.h"
#include "scalarsite_generic/generic_adj_mat_vec.h"
#include "scalarsite_generic/generic_addvec.h"


// #define QDP_SCALARSITE_DEBUG

// Optimized version of
Expand Down
6 changes: 3 additions & 3 deletions include/qdp_scalarvecsite_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#ifndef QDP_SCALARVECSITE_DEFS_H
#define QDP_SCALARVECSITE_DEFS_H

#include <qdp_config.h>
#include "qdp_precision.h"

namespace QDP {


Expand All @@ -19,9 +22,6 @@ namespace QDP {
* @{
*/

#include <qdp_config.h>
#include "qdp_precision.h"

//----------------------------------------------------------------------
//! Gamma matrices are conveniently defined for this Ns
typedef GammaType<Ns> Gamma;
Expand Down
3 changes: 2 additions & 1 deletion include/qdp_sse_intrin.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifndef QDP_SSE_INTRIN_H
#define QDP_SSE_INTRIN_H

#include <xmmintrin.h>

// Include the file with the SSE intrinsics in it
namespace QDP {
#include <xmmintrin.h>
typedef __m128 v4sf;

typedef union {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#ifndef QDP_SCALARSITE_BAGEL_QDP_LINALG_H
#define QDP_SCALARSITE_BAGEL_QDP_LINALG_H

#include "bagel_qdp.h"

namespace QDP {

/*! @defgroup optimizations Optimizations
Expand All @@ -21,10 +23,6 @@ namespace QDP {

// Use this def just to safe some typing later on in the file



#include "bagel_qdp.h"

#if 1
typedef RComplex<BAGELQDPFloat> RComplexFloat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
#ifndef QDP_GENERIC_FUSED_SPIN_PROJ_EVALUATES_H
#define QDP_GENERIC_FUSED_SPIN_PROJ_EVALUATES_H


/* Evaluates for things like adj(u)*spinProjectDir0Plus(y) */
using namespace QDP;
namespace QDP {

typedef PScalar< PColorMatrix< RComplex<REAL>, 3> > SU3Mat;
} // namespace QDP;

// ther wrappers for the functions to be threaded
#include "qdp_generic_fused_spin_proj_evaluates_wrapper.h"

/* Evaluates for things like adj(u)*spinProjectDir0Plus(y) */
namespace QDP {

////////////////////////////////
// Threading evaluates
//
// by Xu Guo, EPCC, 28 August, 2008
////////////////////////////////

// ther wrappers for the functions to be threaded
#include "qdp_generic_fused_spin_proj_evaluates_wrapper.h"


// HalfVec = adj(u)*SpinProjectDir0Plus(Vec);
template<>
inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef QDP_GENERIC_FUSED_SPIN_PROJ_EVALUATES_WRAPPER_H
#define QDP_GENERIC_FUSED_SPIN_PROJ_EVALUATES_WRAPPER_H

namespace QDP {

////////////////////////////////
// Threading evaluates wrappers
//
Expand Down Expand Up @@ -33,7 +35,7 @@ void ordered_fused_spin_proj_evaluate_function (int lo, int hi, int myId, ordere
for (int site = low; site < high; site++){
HVec tmp;
func( (REAL *)&(a.elem(site).elem(0).elem(0).real()),(REAL *)&(tmp.elem(0).elem(0).real()), 1);

_inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
_inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
}
Expand Down Expand Up @@ -63,18 +65,17 @@ void unordered_fused_spin_proj_evaluate_function (int lo, int hi, int myId, unor

for (int j = lo; j < hi; j++){
int site = tab[j];

HVec tmp;
func( (REAL *)&(a.elem(site).elem(0).elem(0).real()), (REAL *)&(tmp.elem(0).elem(0).real()), 1);


_inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
_inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
}

}



} // namespace QDP;

#endif
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#ifndef QDP_GENERIC_FUSED_SPIN_RECON_EVALUATES_H
#define QDP_GENERIC_FUSED_SPIN_RECON_EVALUATES_H

namespace QDP {
// the wrappers for the functions to be threaded
#include "qdp_generic_fused_spin_recon_evaluates_wrapper.h"

namespace QDP {

////////////////////////////////
// Threading evaluates
//
// by Xu Guo, EPCC, 28 August, 2008
////////////////////////////////

// the wrappers for the functions to be threaded
#include "qdp_generic_fused_spin_recon_evaluates_wrapper.h"


// Vec = SpinReconstructDir0Plus( u * psi);
template<>
Expand Down Expand Up @@ -1210,8 +1209,4 @@ void evaluate(OLattice< FVec >& d,

} // namespace QDP;





#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef QDP_GENERIC_FUSED_SPIN_RECON_EVALUATES_WRAPPER_H
#define QDP_GENERIC_FUSED_SPIN_RECON_EVALUATES_WRAPPER_H

namespace QDP {

////////////////////////////////
// Threading evaluates wrappers
//
Expand Down Expand Up @@ -34,8 +36,8 @@ void ordered_fused_spin_recon_evaluate_function (int lo, int hi, int myId, order
HVec tmp;
_inline_mult_su3_mat_vec(u.elem(site).elem(), a.elem(site).elem(0), tmp.elem(0));
_inline_mult_su3_mat_vec(u.elem(site).elem(), a.elem(site).elem(1), tmp.elem(1));


func( (REAL *)&(tmp.elem(0).elem(0).real()), (REAL *)&(d.elem(site).elem(0).elem(0).real()), 1);
}

Expand Down Expand Up @@ -65,19 +67,18 @@ void unordered_fused_spin_recon_evaluate_function (int lo, int hi, int myId, uno
for (int j = lo; j < hi; j++){

int site = tab[j];

HVec tmp;
_inline_mult_su3_mat_vec(u.elem(site).elem(), a.elem(site).elem(0), tmp.elem(0));
_inline_mult_su3_mat_vec(u.elem(site).elem(), a.elem(site).elem(1), tmp.elem(1));


func( (REAL *)&(tmp.elem(0).elem(0).real()), (REAL *)&(d.elem(site).elem(0).elem(0).real()),1);
}

}



} // namespace QDP;


#endif
11 changes: 7 additions & 4 deletions include/scalarsite_generic/qdp_generic_spin_project_evaluates.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef QDP_GENERIC_SPIN_PROJECT_EVALUTATES_H
#define QDP_GENERIC_SPIN_PROJECT_EVALUTATES_H

using namespace QDP;
namespace QDP {

// Typedefs
Expand All @@ -15,15 +14,19 @@ typedef REAL SpinColFull[4][3][2];
typedef REAL SpinColHalf[2][3][2];
// d = SpinProjectDir0Plus(Vec);

} // namespace QDP;

// the wrappers for the functions to be threaded
#include "qdp_generic_spin_project_evaluates_wrapper.h"

namespace QDP {

////////////////////////////////
// Threading evaluates
//
// by Xu Guo, EPCC, 28 August, 2008
////////////////////////////////

// the wrappers for the functions to be threaded
#include "qdp_generic_spin_project_evaluates_wrapper.h"


template<class A, class B>
inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef QDP_GENERIC_SPIN_PROJECT_EVALUATES_WRAPPER_H
#define QDP_GENERIC_SPIN_PROJECT_EVALUATES_WRAPPER_H

namespace QDP {

////////////////////////////////
// Threading evaluates wrappers
Expand Down Expand Up @@ -64,9 +65,6 @@ void unordered_spin_project_evaluate_function (int lo, int hi, int myId, unorder

}





} // namespace QDP

#endif
Loading