Skip to content

Commit

Permalink
Merge branch 'development' into gpu-merge-test
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers committed Oct 15, 2018
2 parents 5ab12ea + d0ab3db commit b026bc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Src/Base/AMReX_BaseFab.H
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ template <class T>
IntVect
BaseFab<T>::minIndex (const Box& subbox, int comp) const
{
int imin, jmin, kmin;
AMREX_D_DECL(int imin, jmin, kmin);
T min_val = std::numeric_limits<T>::max();

const auto dp0 = this->stridedPtr(subbox,comp);
Expand All @@ -2180,7 +2180,7 @@ BaseFab<T>::minIndex (const Box& subbox, int comp) const
for (int i = 0; i < len[0]; ++i) {
if (dp[i] < min_val) {
min_val = dp[i];
imin = i; jmin = j; kmin = k;
AMREX_D_TERM(imin = i;, jmin = j;, kmin = k;)
}
}
}
Expand All @@ -2202,7 +2202,7 @@ IntVect
BaseFab<T>::maxIndex (const Box& subbox,
int comp) const
{
int imax, jmax, kmax;
AMREX_D_DECL(int imax, jmax, kmax);
T max_val = std::numeric_limits<T>::lowest();

const auto dp0 = this->stridedPtr(subbox,comp);
Expand All @@ -2214,7 +2214,7 @@ BaseFab<T>::maxIndex (const Box& subbox,
for (int i = 0; i < len[0]; ++i) {
if (dp[i] > max_val) {
max_val = dp[i];
imax = i; jmax = j; kmax = k;
AMREX_D_TERM(imax = i;, jmax = j;, kmax = k;)
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions Tools/F_scripts/write_cuda_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ def convert_cxx(outdir, cxx_files, cpp, defines):
"#endif\n".format(func_name))
hout.write(" cuda_{}<<<{}numBlocks, {}numThreads, 0, amrex::Device::cudaStream()>>>\n ({});\n".format(func_name, func_name, func_name, args))

# Catch errors in the launch configuration.

hout.write(" CudaAPICheck(cudaGetLastError());\n")

if 'AMREX_DEBUG' in defines:
hout.write("CudaAPICheck(cudaDeviceSynchronize());\n")

Expand Down

0 comments on commit b026bc7

Please sign in to comment.