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

Fix a bug in Tutorials/GPU/CNS #1245

Merged
merged 1 commit into from
Aug 10, 2020
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
4 changes: 3 additions & 1 deletion Src/Base/AMReX_FBI.H
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ FabArray<FAB>::FB_pack_send_buffer_cuda_graph (const FB& TheFB, int scomp, int n

dptr += (tag.sbox.numPts() * ncomp * sizeof(value_type));
}
amrex::ignore_unused(send_size);
BL_ASSERT(dptr <= send_data[j] + send_size[j]);
}
}
Expand All @@ -999,7 +1000,7 @@ FabArray<FAB>::FB_unpack_recv_buffer_cuda_graph (const FB& TheFB, int dcomp, int
Vector<char*> const& recv_data,
Vector<std::size_t> const& recv_size,
Vector<CopyComTagsContainer const*> const& recv_cctc,
bool is_thread_safe)
bool /*is_thread_safe*/)
{
const int N_rcvs = recv_cctc.size();
if (N_rcvs == 0) return;
Expand All @@ -1018,6 +1019,7 @@ FabArray<FAB>::FB_unpack_recv_buffer_cuda_graph (const FB& TheFB, int dcomp, int
dptr += tag.dbox.numPts() * ncomp * sizeof(value_type);
launches++;
}
amrex::ignore_unused(recv_size);
BL_ASSERT(dptr <= recv_data[k] + recv_size[k]);
}
}
Expand Down
10 changes: 5 additions & 5 deletions Tutorials/GPU/CNS/Exec/RT/cns_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <AMReX_ParmParse.H>

extern "C" {
void amrex_probinit (const int* init,
const int* name,
const int* namelen,
const amrex_real* problo,
const amrex_real* probhi)
void amrex_probinit (const int* /*init*/,
const int* /*name*/,
const int* /*namelen*/,
const amrex_real* /*problo*/,
const amrex_real* /*probhi*/)
{
// could read parmparse parameters here
}
Expand Down
10 changes: 5 additions & 5 deletions Tutorials/GPU/CNS/Exec/Sod/cns_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#include "CNS.H"

extern "C" {
void amrex_probinit (const int* init,
const int* name,
const int* namelen,
const amrex_real* problo,
const amrex_real* probhi)
void amrex_probinit (const int* /*init*/,
const int* /*name*/,
const int* /*namelen*/,
const amrex_real* /*problo*/,
const amrex_real* /*probhi*/)
{
amrex::ParmParse pp("prob");

Expand Down
16 changes: 8 additions & 8 deletions Tutorials/GPU/CNS/Source/CNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ CNS::initData ()

void
CNS::computeInitialDt (int finest_level,
int sub_cycle,
int /*sub_cycle*/,
Vector<int>& n_cycle,
const Vector<IntVect>& ref_ratio,
const Vector<IntVect>& /*ref_ratio*/,
Vector<Real>& dt_level,
Real stop_time)
{
Expand Down Expand Up @@ -144,9 +144,9 @@ CNS::computeInitialDt (int finest_level,

void
CNS::computeNewDt (int finest_level,
int sub_cycle,
int /*sub_cycle*/,
Vector<int>& n_cycle,
const Vector<IntVect>& ref_ratio,
const Vector<IntVect>& /*ref_ratio*/,
Vector<Real>& dt_min,
Vector<Real>& dt_level,
Real stop_time,
Expand Down Expand Up @@ -218,12 +218,12 @@ CNS::computeNewDt (int finest_level,
}

void
CNS::post_regrid (int lbase, int new_finest)
CNS::post_regrid (int /*lbase*/, int /*new_finest*/)
{
}

void
CNS::post_timestep (int iteration)
CNS::post_timestep (int /*iteration*/)
{
BL_PROFILE("post_timestep");

Expand All @@ -239,7 +239,7 @@ CNS::post_timestep (int iteration)
}

void
CNS::postCoarseTimeStep (Real time)
CNS::postCoarseTimeStep (Real /*time*/)
{
BL_PROFILE("postCoarseTimeStep()");

Expand Down Expand Up @@ -290,7 +290,7 @@ CNS::post_restart ()
}

void
CNS::errorEst (TagBoxArray& tags, int, int, Real time, int, int)
CNS::errorEst (TagBoxArray& tags, int, int, Real /*time*/, int, int)
{
BL_PROFILE("CNS::errorEst()");

Expand Down
2 changes: 1 addition & 1 deletion Tutorials/GPU/CNS/Source/CNS_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using namespace amrex;

Real
CNS::advance (Real time, Real dt, int iteration, int ncycle)
CNS::advance (Real time, Real dt, int /*iteration*/, int /*ncycle*/)
{
BL_PROFILE("CNS::advance()");

Expand Down
2 changes: 1 addition & 1 deletion Tutorials/GPU/CNS/Source/CNS_derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ void cns_dervel (const Box& bx, FArrayBox& velfab, int dcomp, int /*ncomp*/,
amrex::ParallelFor(bx,
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
vel(i,j,k,dcomp) = vel(i,j,k,1)/vel(i,j,k,0);
vel(i,j,k,dcomp) = dat(i,j,k,1)/dat(i,j,k,0);
});
}