mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-09 23:45:36 +00:00
Compare commits
No commits in common. "d299c86633e877847510947a00a031e42e80d431" and "fb9b1d76caf64860e57b789082b66b45b14029e2" have entirely different histories.
d299c86633
...
fb9b1d76ca
@ -13,7 +13,6 @@ inline typename vobj::scalar_objectD sumD_gpu_tensor(const vobj *lat, Integer os
|
||||
mysum.resize(1);
|
||||
sobj *mysum_p = & mysum[0];
|
||||
sobj identity; zeroit(identity);
|
||||
mysum[0] = identity;
|
||||
sobj ret ;
|
||||
|
||||
Integer nsimd= vobj::Nsimd();
|
||||
@ -81,14 +80,13 @@ template<class Word> Word svm_xor(Word *vec,uint64_t L)
|
||||
d_sum.resize(1);
|
||||
Word *d_sum_p=&d_sum[0];
|
||||
Word identity; identity=0;
|
||||
d_sum[0] = identity;
|
||||
const cl::sycl::property_list PropList ({ cl::sycl::property::reduction::initialize_to_identity() });
|
||||
theGridAccelerator->submit([&](cl::sycl::handler &cgh) {
|
||||
auto Reduction = cl::sycl::reduction(d_sum_p,identity,std::bit_xor<>(),PropList);
|
||||
cgh.parallel_for(cl::sycl::range<1>{L},
|
||||
Reduction,
|
||||
[=] (cl::sycl::id<1> index, auto &sum) {
|
||||
sum^=vec[index];
|
||||
sum ^=vec[index];
|
||||
});
|
||||
});
|
||||
theGridAccelerator->wait();
|
||||
|
@ -99,8 +99,6 @@ using std::log;
|
||||
using std::exp;
|
||||
using std::sin;
|
||||
using std::cos;
|
||||
using std::asin;
|
||||
using std::acos;
|
||||
|
||||
|
||||
accelerator_inline RealF conjugate(const RealF & r){ return r; }
|
||||
|
@ -142,9 +142,7 @@ int main (int argc, char ** argv)
|
||||
std:: cout << " CG site flops = "<< CGsiteflops <<std::endl;
|
||||
int iters;
|
||||
|
||||
time_t now;
|
||||
time_t start = time(NULL);
|
||||
UGrid->Broadcast(0,(void *)&start,sizeof(start));
|
||||
|
||||
FlightRecorder::ContinueOnFail = 0;
|
||||
FlightRecorder::PrintEntireLog = 0;
|
||||
@ -164,9 +162,9 @@ int main (int argc, char ** argv)
|
||||
}
|
||||
std::cerr << "******************* SINGLE PRECISION SOLVE "<<iter<<std::endl;
|
||||
result_o = Zero();
|
||||
t1=usecond();
|
||||
t1=usecond();
|
||||
mCG(src_o,result_o);
|
||||
t2=usecond();
|
||||
t2=usecond();
|
||||
iters = mCG.TotalInnerIterations; //Number of inner CG iterations
|
||||
flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
|
||||
flops+= CGsiteflops*FrbGrid->gSites()*iters;
|
||||
@ -178,8 +176,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
std::cout << " FlightRecorder is OK! "<<std::endl;
|
||||
iter ++;
|
||||
now = time(NULL); UGrid->Broadcast(0,(void *)&now,sizeof(now));
|
||||
} while (now < (start + nsecs/10) );
|
||||
} while (time(NULL) < (start + nsecs/10) );
|
||||
|
||||
std::cout << GridLogMessage << "::::::::::::: Starting double precision CG" << std::endl;
|
||||
ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000);
|
||||
@ -192,7 +189,7 @@ int main (int argc, char ** argv)
|
||||
}
|
||||
std::cerr << "******************* DOUBLE PRECISION SOLVE "<<i<<std::endl;
|
||||
result_o_2 = Zero();
|
||||
t1=usecond();
|
||||
t1=usecond();
|
||||
CG(HermOpEO,src_o,result_o_2);
|
||||
t2=usecond();
|
||||
iters = CG.IterationsToComplete;
|
||||
@ -204,9 +201,8 @@ int main (int argc, char ** argv)
|
||||
std::cout << " DoublePrecision error count "<< FlightRecorder::ErrorCount()<<std::endl;
|
||||
assert(FlightRecorder::ErrorCount()==0);
|
||||
std::cout << " FlightRecorder is OK! "<<std::endl;
|
||||
now = time(NULL); UGrid->Broadcast(0,(void *)&now,sizeof(now));
|
||||
i++;
|
||||
} while (now < (start + nsecs) );
|
||||
} while (time(NULL) < (start + nsecs) );
|
||||
|
||||
LatticeFermionD diff_o(FrbGrid);
|
||||
RealD diff = axpy_norm(diff_o, -1.0, result_o, result_o_2);
|
||||
|
Loading…
Reference in New Issue
Block a user