Skip to content

Commit

Permalink
Fix in 2D for NCIGodfreyFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgrote committed Jun 11, 2024
1 parent 0df1442 commit d383e51
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/Filter/NCIGodfreyFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ void NCIGodfreyFilter::ComputeStencils()
h_stencil_z[0] /= 2._rt;

stencil_x.resize(h_stencil_x.size());
Gpu::copyAsync(Gpu::hostToDevice,h_stencil_x.begin(),h_stencil_x.end(),stencil_x.begin());
# if defined(WARPX_DIM_3D)
stencil_y.resize(h_stencil_y.size());
stencil_z.resize(h_stencil_z.size());
Gpu::copyAsync(Gpu::hostToDevice,h_stencil_y.begin(),h_stencil_y.end(),stencil_y.begin());
Gpu::copyAsync(Gpu::hostToDevice,h_stencil_z.begin(),h_stencil_z.end(),stencil_z.begin());
# elif (AMREX_SPACEDIM == 2)
// In 2D, the filter applies stencil_y to the 2nd dimension
stencil_y.resize(h_stencil_z.size());
# endif

Gpu::copyAsync(Gpu::hostToDevice,h_stencil_x.begin(),h_stencil_x.end(),stencil_x.begin());
Gpu::copyAsync(Gpu::hostToDevice,h_stencil_y.begin(),h_stencil_y.end(),stencil_y.begin());
# if defined(WARPX_DIM_3D)
Gpu::copyAsync(Gpu::hostToDevice,h_stencil_z.begin(),h_stencil_z.end(),stencil_z.begin());
Gpu::copyAsync(Gpu::hostToDevice,h_stencil_z.begin(),h_stencil_z.end(),stencil_y.begin());
# endif

Gpu::synchronize();
Expand Down

0 comments on commit d383e51

Please sign in to comment.