Skip to content

Commit

Permalink
Address warnings in CUDA builds (AMReX-Codes#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
sayerhs authored Oct 18, 2020
1 parent aef02b9 commit 4f00520
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Src/Base/AMReX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,11 @@ amrex::write_to_stderr_without_buffering (const char* str)
}
}

#if !AMREX_DEVICE_COMPILE
namespace {
// Having both host and device versions to avoid compiler warning
AMREX_GPU_HOST_DEVICE
void
write_lib_id(const char* msg)
{
#if AMREX_DEVICE_COMPILE
amrex::ignore_unused(msg);
#else
fflush(0);
const char* const s = "amrex::";
fwrite(s, strlen(s), 1, stderr);
Expand All @@ -165,9 +161,9 @@ write_lib_id(const char* msg)
fwrite(msg, strlen(msg), 1, stderr);
fwrite("::", 2, 1, stderr);
}
#endif
}
}
#endif

void
amrex::Error (const std::string& msg)
Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_FBI.H
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,8 @@ FabArray<FAB>::unpack_recv_buffer_gpu (FabArray<FAB>& dst, int dcomp, int ncomp,
if (N_rcvs == 0) return;

char* pbuffer = recv_data[0];
std::size_t szbuffer = 0;
#if 0
std::size_t szbuffer = 0;
// For linear solver test on summit, this is slower than writing to
// pinned memory directly on device.
if (not ParallelDescriptor::UseGpuAwareMpi()) {
Expand Down
2 changes: 2 additions & 0 deletions Tools/Plotfile/fsnapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ void main_main()
}
}
}
amrex::ignore_unused(numElements);

PlotFileData pf(pltfile);
int dim = pf.spaceDim();
Expand Down Expand Up @@ -178,6 +179,7 @@ void main_main()
ndir_end = ndir_begin+1;
ndirs = 1;
}
amrex::ignore_unused(ndirs);

Vector<Box> finebox(3, finedomainbox);
Vector<MultiFab> datamf(3);
Expand Down

0 comments on commit 4f00520

Please sign in to comment.