diff --git a/Source/reactions/Castro_react.cpp b/Source/reactions/Castro_react.cpp index 7fc8e069b9..ee9807dfb9 100644 --- a/Source/reactions/Castro_react.cpp +++ b/Source/reactions/Castro_react.cpp @@ -417,6 +417,11 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra #if defined(AMREX_USE_HIP) Gpu::streamSynchronize(); // otherwise HIP may fail to allocate the necessary resources. #endif + +#ifdef ALLOW_GPU_PRINTF + std::fflush(nullptr); +#endif + } #if defined(AMREX_USE_GPU) @@ -812,6 +817,11 @@ Castro::react_state(Real time, Real dt) #if defined(AMREX_USE_HIP) Gpu::streamSynchronize(); // otherwise HIP may fail to allocate the necessary resources. #endif + +#ifdef ALLOW_GPU_PRINTF + std::fflush(nullptr); +#endif + } #if defined(AMREX_USE_GPU)