From 5c6702f3847b1ac556a113faf14d1f4bc32c589d Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Thu, 28 Dec 2023 19:17:36 -0800 Subject: [PATCH] Disable optimization for computeRoundOffDomain --- Src/Base/AMReX_Geometry.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Src/Base/AMReX_Geometry.cpp b/Src/Base/AMReX_Geometry.cpp index ace1eefa663..19d2092e9de 100644 --- a/Src/Base/AMReX_Geometry.cpp +++ b/Src/Base/AMReX_Geometry.cpp @@ -513,6 +513,14 @@ Geometry::growPeriodicDomain (int ngrow) const noexcept return growPeriodicDomain(IntVect(ngrow)); } +#if defined(__clang__) +[[clang::optnone]] +#elif defined(__GNUC__) +__attribute__ ((gnu::optimize(0))) +#elif defined(_WIN32) +#define AMREX_WIN32_OPTIMIZE_OFF +#pragma optimize("", off) +#endif void Geometry::computeRoundoffDomain () { @@ -685,6 +693,9 @@ Geometry::computeRoundoffDomain () } } } +#if defined(AMREX_WIN32_OPTIMIZE_OFF) +#pragma optimize("", on) +#endif bool Geometry::outsideRoundoffDomain (AMREX_D_DECL(ParticleReal x, ParticleReal y, ParticleReal z)) const