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:
parent
94f9e781f4
commit
b59553bd65
@ -14,10 +14,10 @@ int main (int argc, char ** argv)
|
||||
std::vector<int> simd_layout(4);
|
||||
|
||||
std::vector<int> mpi_layout(4);
|
||||
mpi_layout[0]=2;
|
||||
mpi_layout[1]=2;
|
||||
mpi_layout[2]=2;
|
||||
mpi_layout[3]=2;
|
||||
mpi_layout[0]=1;
|
||||
mpi_layout[1]=1;
|
||||
mpi_layout[2]=1;
|
||||
mpi_layout[3]=1;
|
||||
|
||||
#ifdef AVX512
|
||||
for(int omp=128;omp<236;omp+=16){
|
||||
|
@ -10,6 +10,7 @@ namespace Grid {
|
||||
typedef typename T::scalar_type scalar_type;
|
||||
typedef typename T::vector_type vector_type;
|
||||
typedef typename T::tensor_reduced tensor_reduced;
|
||||
// enum { TensorLevel = T::TensorLevel };
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
@ -20,24 +21,28 @@ namespace Grid {
|
||||
typedef RealF scalar_type;
|
||||
typedef RealF vector_type;
|
||||
typedef RealF tensor_reduced ;
|
||||
// enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<RealD> {
|
||||
public:
|
||||
typedef RealD scalar_type;
|
||||
typedef RealD vector_type;
|
||||
typedef RealD tensor_reduced;
|
||||
// enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<ComplexF> {
|
||||
public:
|
||||
typedef ComplexF scalar_type;
|
||||
typedef ComplexF vector_type;
|
||||
typedef ComplexF tensor_reduced;
|
||||
// enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<ComplexD> {
|
||||
public:
|
||||
typedef ComplexD scalar_type;
|
||||
typedef ComplexD vector_type;
|
||||
typedef ComplexD tensor_reduced;
|
||||
// enum { TensorLevel = 0 };
|
||||
};
|
||||
|
||||
template<> class GridTypeMapper<vRealF> {
|
||||
@ -45,30 +50,35 @@ namespace Grid {
|
||||
typedef RealF scalar_type;
|
||||
typedef vRealF vector_type;
|
||||
typedef vRealF tensor_reduced;
|
||||
// enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<vRealD> {
|
||||
public:
|
||||
typedef RealD scalar_type;
|
||||
typedef vRealD vector_type;
|
||||
typedef vRealD tensor_reduced;
|
||||
//enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<vComplexF> {
|
||||
public:
|
||||
typedef ComplexF scalar_type;
|
||||
typedef vComplexF vector_type;
|
||||
typedef vComplexF tensor_reduced;
|
||||
//enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<vComplexD> {
|
||||
public:
|
||||
typedef ComplexD scalar_type;
|
||||
typedef vComplexD vector_type;
|
||||
typedef vComplexD tensor_reduced;
|
||||
//enum { TensorLevel = 0 };
|
||||
};
|
||||
template<> class GridTypeMapper<vInteger> {
|
||||
public:
|
||||
typedef Integer scalar_type;
|
||||
typedef vInteger vector_type;
|
||||
typedef vInteger tensor_reduced;
|
||||
//enum { TensorLevel = 0 };
|
||||
};
|
||||
|
||||
// Again terminate the recursion.
|
||||
|
@ -19,6 +19,7 @@ public:
|
||||
typedef typename GridTypeMapper<vtype>::scalar_type scalar_type;
|
||||
typedef typename GridTypeMapper<vtype>::vector_type vector_type;
|
||||
typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v;
|
||||
//enum { TensorLevel = GridTypeMapper<vtype>::TensorLevel + 1};
|
||||
typedef iScalar<tensor_reduced_v> tensor_reduced;
|
||||
|
||||
|
||||
@ -78,6 +79,7 @@ public:
|
||||
typedef typename GridTypeMapper<vtype>::scalar_type scalar_type;
|
||||
typedef typename GridTypeMapper<vtype>::vector_type vector_type;
|
||||
typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v;
|
||||
// enum { TensorLevel = GridTypeMapper<vtype>::TensorLevel + 1};
|
||||
typedef iScalar<tensor_reduced_v> tensor_reduced;
|
||||
|
||||
|
||||
@ -136,6 +138,7 @@ public:
|
||||
typedef typename GridTypeMapper<vtype>::scalar_type scalar_type;
|
||||
typedef typename GridTypeMapper<vtype>::vector_type vector_type;
|
||||
typedef typename GridTypeMapper<vtype>::tensor_reduced tensor_reduced_v;
|
||||
// enum { TensorLevel = GridTypeMapper<vtype>::TensorLevel + 1};
|
||||
typedef iScalar<tensor_reduced_v> tensor_reduced;
|
||||
|
||||
iMatrix(Zero &z){ *this = zero; };
|
||||
|
12
Grid_simd.h
12
Grid_simd.h
@ -273,10 +273,16 @@ namespace Grid {
|
||||
inline void add (vRealD *__restrict__ y,const vRealD *__restrict__ l,const RealD *__restrict__ r){ *y = (*l) + (*r); }
|
||||
|
||||
// Default precision
|
||||
typedef RealD Real;
|
||||
typedef std::complex<Real> Complex;
|
||||
|
||||
#ifdef GRID_DEFAULT_PRECISION_DOUBLE
|
||||
typedef RealD Real;
|
||||
typedef vRealD vReal;
|
||||
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
|
||||
|
@ -373,6 +373,8 @@ friend inline void vstore(const vComplexF &ret, ComplexF *a){
|
||||
{
|
||||
return l*r;
|
||||
}
|
||||
|
||||
inline vComplexF trace(const vComplexF &arg){
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -247,6 +247,9 @@ namespace Grid {
|
||||
{
|
||||
return l*r;
|
||||
}
|
||||
inline vRealD trace(const vRealD &arg){
|
||||
return arg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -268,6 +268,9 @@ friend inline void vstore(const vRealF &ret, float *a){
|
||||
return l*r;
|
||||
}
|
||||
|
||||
inline vRealF trace(const vRealF &arg){
|
||||
return arg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user