1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +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:
paboyle
2018-03-05 00:28:24 +00:00
parent 984e06e2b5
commit 2018077770
25 changed files with 65 additions and 46 deletions

View File

@ -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