mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 12:47:05 +01:00
Make NVCC happy with the compile. This is warning free on 9.1 on my laptop (both make and make tests).
This commit is contained in:
@ -57,7 +57,7 @@ public:
|
||||
RealD , coarse_relax_tol,
|
||||
std::vector<int>, blockSize,
|
||||
std::string, config,
|
||||
std::vector < std::complex<double> >, omega,
|
||||
std::vector < ComplexD >, omega,
|
||||
RealD, mass,
|
||||
RealD, M5);
|
||||
};
|
||||
|
@ -113,9 +113,9 @@ public:
|
||||
RealD GCRnStep(LinearOperatorBase<Field> &Linop,const Field &src, Field &psi,RealD rsq){
|
||||
|
||||
RealD cp;
|
||||
RealD a, b, c, d;
|
||||
RealD a, b;
|
||||
RealD zAz, zAAz;
|
||||
RealD rAq, rq;
|
||||
RealD rq;
|
||||
|
||||
GridBase *grid = src.Grid();
|
||||
|
||||
|
@ -1371,8 +1371,7 @@ struct from_json_fn
|
||||
template<typename BasicJsonType, typename T>
|
||||
void call(const BasicJsonType& /*unused*/, T& /*unused*/, priority_tag<0> /*unused*/) const noexcept
|
||||
{
|
||||
static_assert(sizeof(BasicJsonType) == 0,
|
||||
"could not find from_json() method in T's namespace");
|
||||
static_assert(sizeof(BasicJsonType) == 0,"could not find from_json() method in T's namespace");
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -133,7 +133,7 @@ auto eval(const unsigned int ss, const LatticeTrinaryExpression<Op, T1, T2, T3>
|
||||
// Perhaps a conformable method.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
template <class T1,typename std::enable_if<is_lattice<T1>::value, T1>::type * = nullptr>
|
||||
inline void GridFromExpression(GridBase *&grid, const T1 &lat) // Lattice leaf
|
||||
accelerator_inline void GridFromExpression(GridBase *&grid, const T1 &lat) // Lattice leaf
|
||||
{
|
||||
lat.Conformable(grid);
|
||||
}
|
||||
@ -209,7 +209,7 @@ inline void CBFromExpression(int &cb, const LatticeTrinaryExpression<Op, T1, T2,
|
||||
#define GridUnopClass(name, ret) \
|
||||
template <class arg> \
|
||||
struct name { \
|
||||
static auto inline func(const arg a) -> decltype(ret) { return ret; } \
|
||||
static auto accelerator_inline func(const arg a) -> decltype(ret) { return ret; } \
|
||||
};
|
||||
|
||||
GridUnopClass(UnarySub, -a);
|
||||
@ -242,7 +242,8 @@ GridUnopClass(UnaryExp, exp(a));
|
||||
#define GridBinOpClass(name, combination) \
|
||||
template <class left, class right> \
|
||||
struct name { \
|
||||
static auto inline func(const left &lhs, const right &rhs) \
|
||||
static auto accelerator_inline \
|
||||
func(const left &lhs, const right &rhs) \
|
||||
-> decltype(combination) const \
|
||||
{ \
|
||||
return combination; \
|
||||
@ -264,7 +265,8 @@ GridBinOpClass(BinaryOrOr, lhs || rhs);
|
||||
#define GridTrinOpClass(name, combination) \
|
||||
template <class predicate, class left, class right> \
|
||||
struct name { \
|
||||
static auto inline func(const predicate &pred, const left &lhs, const right &rhs) \
|
||||
static auto accelerator_inline \
|
||||
func(const predicate &pred, const left &lhs, const right &rhs) \
|
||||
-> decltype(combination) const \
|
||||
{ \
|
||||
return combination; \
|
||||
|
@ -177,7 +177,8 @@ static void sliceInnerProductMatrix( Eigen::MatrixXcd &mat, const Lattice<vobj>
|
||||
for(int j=0;j<Nblock;j++){
|
||||
auto tmp = innerProduct(Left[i],Right[j]);
|
||||
auto rtmp = TensorRemove(tmp);
|
||||
mat_thread(i,j) += Reduce(rtmp);
|
||||
ComplexD z = Reduce(rtmp);
|
||||
mat_thread(i,j) += std::complex<double>(real(z),imag(z));
|
||||
}}
|
||||
}});
|
||||
thread_critical {
|
||||
|
@ -54,6 +54,18 @@ namespace Grid
|
||||
void pop(void);
|
||||
template <typename U>
|
||||
void writeDefault(const std::string &s, const U &x);
|
||||
#ifdef __NVCC__
|
||||
void writeDefault(const std::string &s, const Grid::ComplexD &x)
|
||||
{
|
||||
std::complex<double> z(real(x),imag(x));
|
||||
writeDefault(s,z);
|
||||
}
|
||||
void writeDefault(const std::string &s, const Grid::ComplexF &x)
|
||||
{
|
||||
std::complex<float> z(real(x),imag(x));
|
||||
writeDefault(s,z);
|
||||
}
|
||||
#endif
|
||||
template <typename U>
|
||||
void writeDefault(const std::string &s, const std::complex<U> &x);
|
||||
template <typename U>
|
||||
@ -89,6 +101,21 @@ namespace Grid
|
||||
void readDefault(const std::string &s, std::vector<U> &output);
|
||||
template <typename U, typename P>
|
||||
void readDefault(const std::string &s, std::pair<U,P> &output);
|
||||
#ifdef __NVCC__
|
||||
void readDefault(const std::string &s, ComplexD &output)
|
||||
{
|
||||
std::complex<double> z;
|
||||
readDefault(s,z);
|
||||
output = ComplexD(real(z),imag(z));
|
||||
}
|
||||
void readDefault(const std::string &s, ComplexF &output)
|
||||
{
|
||||
std::complex<float> z;
|
||||
readDefault(s,z);
|
||||
output = ComplexD(real(z),imag(z));
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
json jobject_; // main object
|
||||
json jcur_; // current json object
|
||||
|
@ -66,14 +66,13 @@ accelerator_inline iMatrix<vtype,3> Exponentiate(const iMatrix<vtype,3> &arg, Re
|
||||
typedef iMatrix<vtype,3> mat;
|
||||
typedef iScalar<vtype> scalar;
|
||||
mat unit(1.0);
|
||||
mat temp(unit);
|
||||
const Complex one_over_three = 1.0 / 3.0;
|
||||
const Complex one_over_two = 1.0 / 2.0;
|
||||
|
||||
scalar c0, c1, tmp, c0max, theta, u, w;
|
||||
scalar xi0, u2, w2, cosw;
|
||||
scalar fden, h0, h1, h2;
|
||||
scalar e2iu, emiu, ixi0, qt;
|
||||
scalar e2iu, emiu, ixi0;
|
||||
scalar f0, f1, f2;
|
||||
scalar unity(1.0);
|
||||
|
||||
|
Reference in New Issue
Block a user