From e49e95b037a9dd499b23669d0b3ca50f98304347 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 22 Mar 2024 15:39:27 +0000 Subject: [PATCH] Upgrade of the Britney test with flight recorder and fast xor checksum --- Grid/lattice/Lattice_reduction.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Grid/lattice/Lattice_reduction.h b/Grid/lattice/Lattice_reduction.h index 969a4a10..4e11378d 100644 --- a/Grid/lattice/Lattice_reduction.h +++ b/Grid/lattice/Lattice_reduction.h @@ -285,13 +285,25 @@ inline ComplexD rankInnerProduct(const Lattice &left,const Lattice & template inline ComplexD innerProduct(const Lattice &left,const Lattice &right) { GridBase *grid = left.Grid(); - uint32_t csum=0; - // Uint32Checksum(left,csum); + +#ifdef GRID_SYCL + uint64_t csum=0; + if ( FlightRecorder::LoggingMode != FlightRecorder::LoggingModeNone) + { + // Hack + // Fast integer xor checksum. Can also be used in comms now. + autoView(l_v,left,AcceleratorRead); + Integer words = left.Grid()->oSites()*sizeof(vobj)/sizeof(uint64_t); + uint64_t *base= (uint64_t *)&l_v[0]; + csum=svm_xor(base,words); + } + FlightRecorder::CsumLog(csum); +#endif ComplexD nrm = rankInnerProduct(left,right); RealD local = real(nrm); - GridNormLog(real(nrm),csum); // Could log before and after global sum to distinguish local and MPI + FlightRecorder::NormLog(real(nrm)); grid->GlobalSum(nrm); - GridMPINormLog(local,real(nrm)); + FlightRecorder::ReductionLog(local,real(nrm)); return nrm; }