/************************************************************************************* grid` physics library, www.github.com/paboyle/Grid Source file: ./tests/Test_cshift.cc Copyright (C) 2015 Author: Azusa Yamaguchi Author: Peter Boyle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ #include using namespace Grid; template void bench(GridCartesian *grid, std::string name) { Coordinate latt_size = grid->_fdimensions; std::cout<<"*************************************************"<({1,2,3,4})); LatticeObject S(grid); gaussian(RNG,S); typedef typename LatticeObject::vector_object vobj; const int nrep = 50; // Correctness + Parseval pass (unplanned), also the WARMUP that absorbs // FFTW/allocator/MPI first-touch so the two timed passes below are both warm // and the comparison is fair (order confound removed). { LatticeObject Stilde(grid); Stilde=S; FFT theFFT(grid); std::cout << " norm2(s) "< theFFT(grid); // one-time plan build (all dims, fwd+bwd) tc+= usecond(); t_build = tc/1.e6; double tt= -usecond(); for(int r=0;r plan create+destroy "<<(t_unplanned - t_planned)<<" s/call" <<" (one-time build "<(&GRID,std::string("LatticeComplexD")); bench(&GRID,std::string("LatticeColourMatrixD")); bench(&GRID,std::string("LatticeFermionD")); // Ncomp=12, the FreePropagator/Fourier-precon path bench(&GRID,std::string("LatticePropagatorD")); Grid_finalize(); }