Skip to content

Commit 43d71da

Browse files
authored
Limit the scope of gpu_rand_generator (#3659)
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.
1 parent ccd6357 commit 43d71da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Src/Base/AMReX_Random.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ namespace
1919
namespace amrex {
2020
#ifdef AMREX_USE_SYCL
2121
sycl_rng_descr* rand_engine_descr = nullptr;
22-
oneapi::mkl::rng::philox4x32x10* gpu_rand_generator = nullptr;
2322
#else
2423
amrex::randState_t* gpu_rand_state = nullptr;
24+
#endif
25+
}
26+
27+
namespace {
28+
#ifdef AMREX_USE_SYCL
29+
oneapi::mkl::rng::philox4x32x10* gpu_rand_generator = nullptr;
30+
#else
2531
amrex::randGenerator_t gpu_rand_generator = nullptr;
2632
#endif
2733
}

0 commit comments

Comments
 (0)