1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Force a couple of things to compile on NVCC

This commit is contained in:
Peter Boyle 2019-08-15 01:32:03 +01:00
parent be37dfb6f8
commit 4278caa030
2 changed files with 9 additions and 21 deletions

View File

@ -116,23 +116,6 @@ std::vector<std::string> TFourQuark<FImpl1, FImpl2>::getOutput(void)
template <typename FImpl1, typename FImpl2>
void TFourQuark<FImpl1, FImpl2>::tensorprod(LatticeSpinColourSpinColourMatrix &lret, LatticeSpinColourMatrix a, LatticeSpinColourMatrix b)
{
#if 0
parallel_for(auto site=lret.begin();site<lret.end();site++) {
for (int si; si < 4; ++si){
for(int sj; sj <4; ++sj){
for (int ci; ci < 3; ++ci){
for (int cj; cj < 3; ++cj){
for (int sk; sk < 4; ++sk){
for(int sl; sl <4; ++sl){
for (int ck; ck < 3; ++ck){
for (int cl; cl < 3; ++cl){
lret[site]()(si,sj)(ci,cj)(sk,sl)(ck,cl)=a[site]()(si,sj)(ci,cj)*b[site]()(sk,sl)(ck,cl);
}}
}}
}}
}}
}
#else
// FIXME ; is there a general need for this construct ? In which case we should encapsulate the
// below loops in a helper function.
//LOG(Message) << "sp co mat a is - " << a << std::endl;
@ -140,6 +123,9 @@ void TFourQuark<FImpl1, FImpl2>::tensorprod(LatticeSpinColourSpinColourMatrix &l
auto lret_v = lret.View();
auto a_v = a.View();
auto b_v = b.View();
#ifdef GRID_NVCC
#warning "NVCC problem: Removed impossibly slow compile of simple NPR host code in FourQuark.hpp"
#else
thread_foreach( site,lret_v,{
vTComplex left;
for(int si=0; si < Ns; ++si){
@ -171,6 +157,7 @@ void TFourQuark<FImpl1, FImpl2>::setup(void)
template <typename FImpl1, typename FImpl2>
void TFourQuark<FImpl1, FImpl2>::execute(void)
{
#ifndef GRID_NVCC
/*********************************************************************************
@ -234,7 +221,6 @@ We have up to 256 of these including the offdiag (G1 != G2).
Sin = Sin*exp(-Ci*pdotxin); //phase corrections
Sout = Sout*exp(-Ci*pdotxout);
//Set up Gammas
std::vector<Gamma> gammavector;
for( int i=1; i<Gamma::nGamma; i+=2){
@ -268,6 +254,7 @@ We have up to 256 of these including the offdiag (G1 != G2).
}
}
write(writer, "fourquark", result.fourquark);
#endif
}
END_MODULE_NAMESPACE

View File

@ -35,8 +35,9 @@ directory
int main(int argc, char **argv) {
#ifndef GRID_NVCC
using namespace Grid;
;
// Here change the allowed (higher) representations
typedef Representations< FundamentalRepresentation, AdjointRepresentation , TwoIndexSymmetricRepresentation> TheRepresentations;
@ -133,7 +134,7 @@ int main(int argc, char **argv) {
TheHMC.Run(); // no smearing
Grid_finalize();
#endif
} // main