1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Some bug fixes

This commit is contained in:
Peter Boyle 2015-04-14 23:20:16 +01:00
parent ab9a764bb1
commit cab7ef9bc2
7 changed files with 35 additions and 8 deletions

View File

@ -14,10 +14,10 @@ int main (int argc, char ** argv)
std::vector<int> simd_layout(4); std::vector<int> simd_layout(4);
std::vector<int> mpi_layout(4); std::vector<int> mpi_layout(4);
mpi_layout[0]=2; mpi_layout[0]=1;
mpi_layout[1]=2; mpi_layout[1]=1;
mpi_layout[2]=2; mpi_layout[2]=1;
mpi_layout[3]=2; mpi_layout[3]=1;
#ifdef AVX512 #ifdef AVX512
for(int omp=128;omp<236;omp+=16){ for(int omp=128;omp<236;omp+=16){

View File

@ -10,6 +10,7 @@ namespace Grid {
typedef typename T::scalar_type scalar_type; typedef typename T::scalar_type scalar_type;
typedef typename T::vector_type vector_type; typedef typename T::vector_type vector_type;
typedef typename T::tensor_reduced tensor_reduced; typedef typename T::tensor_reduced tensor_reduced;
// enum { TensorLevel = T::TensorLevel };
}; };
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
@ -20,24 +21,28 @@ namespace Grid {
typedef RealF scalar_type; typedef RealF scalar_type;
typedef RealF vector_type; typedef RealF vector_type;
typedef RealF tensor_reduced ; typedef RealF tensor_reduced ;
// enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<RealD> { template<> class GridTypeMapper<RealD> {
public: public:
typedef RealD scalar_type; typedef RealD scalar_type;
typedef RealD vector_type; typedef RealD vector_type;
typedef RealD tensor_reduced; typedef RealD tensor_reduced;
// enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<ComplexF> { template<> class GridTypeMapper<ComplexF> {
public: public:
typedef ComplexF scalar_type; typedef ComplexF scalar_type;
typedef ComplexF vector_type; typedef ComplexF vector_type;
typedef ComplexF tensor_reduced; typedef ComplexF tensor_reduced;
// enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<ComplexD> { template<> class GridTypeMapper<ComplexD> {
public: public:
typedef ComplexD scalar_type; typedef ComplexD scalar_type;
typedef ComplexD vector_type; typedef ComplexD vector_type;
typedef ComplexD tensor_reduced; typedef ComplexD tensor_reduced;
// enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<vRealF> { template<> class GridTypeMapper<vRealF> {
@ -45,30 +50,35 @@ namespace Grid {
typedef RealF scalar_type; typedef RealF scalar_type;
typedef vRealF vector_type; typedef vRealF vector_type;
typedef vRealF tensor_reduced; typedef vRealF tensor_reduced;
// enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<vRealD> { template<> class GridTypeMapper<vRealD> {
public: public:
typedef RealD scalar_type; typedef RealD scalar_type;
typedef vRealD vector_type; typedef vRealD vector_type;
typedef vRealD tensor_reduced; typedef vRealD tensor_reduced;
//enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<vComplexF> { template<> class GridTypeMapper<vComplexF> {
public: public:
typedef ComplexF scalar_type; typedef ComplexF scalar_type;
typedef vComplexF vector_type; typedef vComplexF vector_type;
typedef vComplexF tensor_reduced; typedef vComplexF tensor_reduced;
//enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<vComplexD> { template<> class GridTypeMapper<vComplexD> {
public: public:
typedef ComplexD scalar_type; typedef ComplexD scalar_type;
typedef vComplexD vector_type; typedef vComplexD vector_type;
typedef vComplexD tensor_reduced; typedef vComplexD tensor_reduced;
//enum { TensorLevel = 0 };
}; };
template<> class GridTypeMapper<vInteger> { template<> class GridTypeMapper<vInteger> {
public: public:
typedef Integer scalar_type; typedef Integer scalar_type;
typedef vInteger vector_type; typedef vInteger vector_type;
typedef vInteger tensor_reduced; typedef vInteger tensor_reduced;
//enum { TensorLevel = 0 };
}; };
// Again terminate the recursion. // Again terminate the recursion.

View File

@ -19,6 +19,7 @@ public:
typedef typename GridTypeMapper<vtype>::scalar_type scalar_type; typedef typename GridTypeMapper<vtype>::scalar_type scalar_type;
typedef typename GridTypeMapper<vtype>::vector_type vector_type; typedef typename GridTypeMapper<vtype>::vector_type vector_type;
typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v; typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v;
//enum { TensorLevel = GridTypeMapper<vtype>::TensorLevel + 1};
typedef iScalar<tensor_reduced_v> tensor_reduced; typedef iScalar<tensor_reduced_v> tensor_reduced;
@ -78,6 +79,7 @@ public:
typedef typename GridTypeMapper<vtype>::scalar_type scalar_type; typedef typename GridTypeMapper<vtype>::scalar_type scalar_type;
typedef typename GridTypeMapper<vtype>::vector_type vector_type; typedef typename GridTypeMapper<vtype>::vector_type vector_type;
typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v; typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v;
// enum { TensorLevel = GridTypeMapper<vtype>::TensorLevel + 1};
typedef iScalar<tensor_reduced_v> tensor_reduced; typedef iScalar<tensor_reduced_v> tensor_reduced;
@ -136,6 +138,7 @@ public:
typedef typename GridTypeMapper<vtype>::scalar_type scalar_type; typedef typename GridTypeMapper<vtype>::scalar_type scalar_type;
typedef typename GridTypeMapper<vtype>::vector_type vector_type; typedef typename GridTypeMapper<vtype>::vector_type vector_type;
typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v; typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v;
// enum { TensorLevel = GridTypeMapper<vtype>::TensorLevel + 1};
typedef iScalar<tensor_reduced_v> tensor_reduced; typedef iScalar<tensor_reduced_v> tensor_reduced;
iMatrix(Zero &z){ *this = zero; }; iMatrix(Zero &z){ *this = zero; };

View File

@ -273,10 +273,16 @@ namespace Grid {
inline void add (vRealD *__restrict__ y,const vRealD *__restrict__ l,const RealD *__restrict__ r){ *y = (*l) + (*r); } inline void add (vRealD *__restrict__ y,const vRealD *__restrict__ l,const RealD *__restrict__ r){ *y = (*l) + (*r); }
// Default precision // Default precision
typedef RealD Real; #ifdef GRID_DEFAULT_PRECISION_DOUBLE
typedef std::complex<Real> Complex; typedef RealD Real;
typedef vRealD vReal; typedef vRealD vReal;
typedef vComplexD vComplex; typedef vComplexD vComplex;
typedef std::complex<Real> Complex;
#else
typedef RealF Real;
typedef vRealF vReal;
typedef vComplexF vComplex;
typedef std::complex<Real> Complex;
#endif
} }
#endif #endif

View File

@ -373,6 +373,8 @@ friend inline void vstore(const vComplexF &ret, ComplexF *a){
{ {
return l*r; return l*r;
} }
inline vComplexF trace(const vComplexF &arg){
return arg;
}
} }
#endif #endif

View File

@ -247,6 +247,9 @@ namespace Grid {
{ {
return l*r; return l*r;
} }
inline vRealD trace(const vRealD &arg){
return arg;
}
} }

View File

@ -268,6 +268,9 @@ friend inline void vstore(const vRealF &ret, float *a){
return l*r; return l*r;
} }
inline vRealF trace(const vRealF &arg){
return arg;
}
} }