1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

Make tests running past nvcc. Different NVCC versions proving tricky to keep happy. This is 9.2

This commit is contained in:
Peter Boyle 2019-01-02 12:05:30 +00:00
parent a4d9200293
commit e73b909a48
6 changed files with 25 additions and 21 deletions

View File

@ -481,7 +481,7 @@ struct Rotate{
// Some Template specialization
// Hack for CLANG until mm512_reduce_add_ps etc... are implemented in GCC and Clang releases
#ifndef __INTEL_COMPILER
#if 0
#warning "Slow reduction due to incomplete reduce intrinsics"
//Complex float Reduce
template<>

View File

@ -746,11 +746,12 @@ accelerator_inline Grid_simd<S, V> operator/(Grid_simd<S, V> a, Grid_simd<S, V>
ret = a * conjugate(b) ;
den = b * conjugate(b) ;
auto real_den = toReal(den);
ret.v=binary<V>(ret.v, real_den.v, DivSIMD());
// duplicates real part
auto real_den = toReal(den);
simd zden;
memcpy((void *)&zden.v,(void *)&real_den.v,sizeof(zden));
ret.v=binary<V>(ret.v, zden.v, DivSIMD());
return ret;
};
@ -839,26 +840,28 @@ accelerator_inline Grid_simd<S, V> trace(const Grid_simd<S, V> &arg) {
// insert real into complex and zero imag;
////////////////////////////////////////////////////////////
template <class T> struct toRealMapper {};
template<> struct toRealMapper<vComplexF> { typedef vRealF Realified; };
template<> struct toRealMapper<vComplexD> { typedef vRealD Realified; };
// real = toReal( complex )
template <class S, class V, IfReal<S> = 0>
accelerator_inline Grid_simd<S, V> toReal(const Grid_simd<complex<S>, V> &in) {
typedef Grid_simd<S, V> simd;
simd ret;
typename simd::conv_t conv;
conv.v = in.v; // copy the vector content (bytewise)
for (int i = 0; i < simd::Nsimd(); i += 2) {
template <class Csimd> // must be a real arg
accelerator_inline typename toRealMapper<Csimd>::Realified toReal(const Csimd &in) {
typedef typename toRealMapper<Csimd>::Realified Rsimd;
Rsimd ret;
typename Rsimd::conv_t conv;
memcpy((void *)&conv.v,(void *)&in.v,sizeof(conv.v));
for (int i = 0; i < Rsimd::Nsimd(); i += 2) {
conv.s[i + 1] = conv.s[i]; // duplicate (r,r);(r,r);(r,r); etc...
}
ret.v = conv.v;
memcpy((void *)&ret.v,(void *)&conv.v,sizeof(ret.v));
return ret;
}
template <class T> struct toComplexMapper {};
template<> struct toComplexMapper<vRealF> { typedef vComplexF Complexified; };
template<> struct toComplexMapper<vRealD> { typedef vComplexD Complexified; };
// complex = toComplex( real )
template <class Rsimd> // must be a real arg
accelerator_inline typename toComplexMapper<Rsimd>::Complexified toComplex(const Rsimd &in) {

View File

@ -55,6 +55,7 @@ template<class vtype, int N> accelerator_inline iVector<vtype, N> Exponentiate(c
// Specialisation: Cayley-Hamilton exponential for SU(3)
#ifndef GRID_NVCC
template<class vtype, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0>::type * =nullptr>
accelerator_inline iMatrix<vtype,3> Exponentiate(const iMatrix<vtype,3> &arg, RealD alpha , Integer Nexp = DEFAULT_MAT_EXP )
{
@ -114,7 +115,7 @@ accelerator_inline iMatrix<vtype,3> Exponentiate(const iMatrix<vtype,3> &arg, Re
return (f0 * unit + timesMinusI(f1) * arg*alpha - f2 * iQ2);
}
#endif
// General exponential

View File

@ -179,7 +179,7 @@ int main(int argc, char **argv) {
std::cout << "Norm2 LatticeReal : "<< norm2(BarReal) << std::endl;
std::cout << "Norm2 LatticeComplex : "<< norm2(BarComplex) << std::endl;
exit(0);
// exit(0);
TComplex tr = trace(cmat);

View File

@ -87,9 +87,9 @@ int main (int argc, char ** argv)
auto Uprime_v = Uprime.View();
auto U_v = U.View();
auto mom_v = mom.View();
parallel_for(auto i=mom_v.begin();i<mom_v.end();i++){ // exp(pmu dt) * Umu
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{ // exp(pmu dt) * Umu
Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ;
}
});
}
ComplexD Sprime = Action.S(Uprime);

View File

@ -109,10 +109,10 @@ int main(int argc, char **argv)
auto Uprime_v = Uprime.View();
auto U_v = U.View();
auto mom_v = mom.View();
parallel_for(int ss = 0; ss < mom.Grid()->oSites(); ss++)
thread_loop( (int ss = 0; ss < mom.Grid()->oSites(); ss++),
{
Uprime_v[ss]._internal[mu] = ProjectOnGroup(Exponentiate(mom_v[ss]._internal[mu], dt, 12) * U_v[ss]._internal[mu]);
}
});
}
std::cout << GridLogMessage << "Initial mom hamiltonian is " << Hmom << std::endl;