Skip to content

Commit

Permalink
Limit the scope of gpu_rand_generator (AMReX-Codes#3659)
Browse files Browse the repository at this point in the history
Move gpu_rand_generator from namespace amrex to anonymous namespace. The
variable is only used in AMReX_Random.cpp, so there are no reasons for
it to be in the amrex namespace.
  • Loading branch information
WeiqunZhang authored and guj committed Dec 13, 2023
1 parent 4f81514 commit 7d0575d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Src/Base/AMReX_Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ namespace
namespace amrex {
#ifdef AMREX_USE_SYCL
sycl_rng_descr* rand_engine_descr = nullptr;
oneapi::mkl::rng::philox4x32x10* gpu_rand_generator = nullptr;
#else
amrex::randState_t* gpu_rand_state = nullptr;
#endif
}

namespace {
#ifdef AMREX_USE_SYCL
oneapi::mkl::rng::philox4x32x10* gpu_rand_generator = nullptr;
#else
amrex::randGenerator_t gpu_rand_generator = nullptr;
#endif
}
Expand Down

0 comments on commit 7d0575d

Please sign in to comment.