mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-15 14:27:06 +01:00
Make tests running past nvcc. Different NVCC versions proving tricky to keep happy. This is 9.2
This commit is contained in:
@ -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<>
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user