Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add templating for the cell bilinear interpolators #2979

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Src/AmrCore/AMReX_MFInterp_1D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ void mf_cell_cons_lin_interp_sph (int i, int ns, Array4<Real> const& fine, int f
+ xoff * slope(ic,0,0,ns);
}

template<typename T>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void mf_cell_bilin_interp (int i, int, int, int n, Array4<Real> const& fine, int fcomp,
Array4<Real const> const& crse, int ccomp, IntVect const& ratio) noexcept
void mf_cell_bilin_interp (int i, int, int, int n, Array4<T> const& fine, int fcomp,
Array4<T const> const& crse, int ccomp, IntVect const& ratio) noexcept
{
int ic = amrex::coarsen(i,ratio[0]);
int ioff = i - ic*ratio[0];
Expand Down
5 changes: 3 additions & 2 deletions Src/AmrCore/AMReX_MFInterp_2D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,10 @@ void mf_cell_cons_lin_interp_rz (int i, int j, int ns, Array4<Real> const& fine,
+ yoff * slope(ic,jc,0,ns+ncomp);
}

template<typename T>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void mf_cell_bilin_interp (int i, int j, int, int n, Array4<Real> const& fine, int fcomp,
Array4<Real const> const& crse, int ccomp, IntVect const& ratio) noexcept
void mf_cell_bilin_interp (int i, int j, int, int n, Array4<T> const& fine, int fcomp,
Array4<T const> const& crse, int ccomp, IntVect const& ratio) noexcept
{
int ic = amrex::coarsen(i,ratio[0]);
int jc = amrex::coarsen(j,ratio[1]);
Expand Down
5 changes: 3 additions & 2 deletions Src/AmrCore/AMReX_MFInterp_3D_C.H
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ void mf_cell_cons_lin_interp (int i, int j, int k, int ns, Array4<Real> const& f
+ zoff * slope(ic,jc,kc,ns+ncomp*2);
}

template<typename T>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void mf_cell_bilin_interp (int i, int j, int k, int n, Array4<Real> const& fine, int fcomp,
Array4<Real const> const& crse, int ccomp, IntVect const& ratio) noexcept
void mf_cell_bilin_interp (int i, int j, int k, int n, Array4<T> const& fine, int fcomp,
Array4<T const> const& crse, int ccomp, IntVect const& ratio) noexcept
{
int ic = amrex::coarsen(i,ratio[0]);
int jc = amrex::coarsen(j,ratio[1]);
Expand Down