From 435eeecb2d2a3e1fdcc443e8c7d8d553c3bb4995 Mon Sep 17 00:00:00 2001 From: rhaas Date: Tue, 15 Apr 2014 19:48:59 +0000 Subject: GRHydro: support array padding in optimized C++ PPM git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@615 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45 --- src/GRHydro_PPMReconstruct_drv_opt.cc | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/GRHydro_PPMReconstruct_drv_opt.cc b/src/GRHydro_PPMReconstruct_drv_opt.cc index 191fb17..76a9ce7 100644 --- a/src/GRHydro_PPMReconstruct_drv_opt.cc +++ b/src/GRHydro_PPMReconstruct_drv_opt.cc @@ -65,13 +65,12 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res Bprim=Bvec; } - int nx=cctk_lsh[0]; - int ny=cctk_lsh[1]; - int nz=cctk_lsh[2]; - int nxy=nx*ny; - int nxyz=nxy*nz; + const int nx=cctk_ash[0]; + const int ny=cctk_ash[1]; + const int nz=cctk_ash[2]; + const int nxy=nx*ny; + const int nxyz=nxy*nz; - //Is there a more efficient way? int nmax_xyz=MAX(nx,MAX(ny,nz)); int type_bitsx,type_bitsy,type_bitsz; @@ -306,11 +305,7 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res CCTK_WARN(0, "Someone needs to figure out which variables to pass for Avec"); } - //This needs to be fixed into a loop for the the template version! - //WE'll need booleans arguments corresponding to the following - //ppm1d_cxx - - ppm1d_cxx_func(nx,CCTK_DELTA_SPACE(0), + ppm1d_cxx_func(cctk_lsh[0],CCTK_DELTA_SPACE(0), &rho1d[0],&velx1d[0],&vely1d[0],&velz1d[0],&eps1d[0],&press1d[0],&temp1d[0], &ye1d[0],&Bvcx1d[0],&Bvcy1d[0],&Bvcz1d[0],&psidc1d[0], &rho1d_minus[0],&velx1d_minus[0],&vely1d_minus[0],&velz1d_minus[0],&eps1d_minus[0],&temp1d_minus[0], @@ -354,7 +349,7 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res } } for (i=0; i - ppm1d_cxx_func - (ny,CCTK_DELTA_SPACE(1), + (cctk_lsh[1],CCTK_DELTA_SPACE(1), &rho1d[0],&vely1d[0],&velz1d[0],&velx1d[0],&eps1d[0],&press1d[0],&temp1d[0], &ye1d[0],&Bvcy1d[0],&Bvcz1d[0],&Bvcx1d[0],&psidc1d[0], &rho1d_minus[0],&vely1d_minus[0],&velz1d_minus[0],&velx1d_minus[0],&eps1d_minus[0],&temp1d_minus[0], @@ -445,7 +436,7 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res } } for (i=0; i - ppm1d_cxx_func - (nz,CCTK_DELTA_SPACE(2), + (cctk_lsh[2],CCTK_DELTA_SPACE(2), &rho1d[0],&velz1d[0],&velx1d[0],&vely1d[0],&eps1d[0],&press1d[0],&temp1d[0], &ye1d[0],&Bvcz1d[0],&Bvcx1d[0],&Bvcy1d[0],&psidc1d[0], &rho1d_minus[0],&velz1d_minus[0],&velx1d_minus[0],&vely1d_minus[0],&eps1d_minus[0],&temp1d_minus[0], @@ -537,7 +524,7 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res } } for (i=0; i