# mode.
#
enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-Wno-unused-local-typedefs")
+
+ #
+ # We are using __builtin_assume in Assert in Release mode and the compiler is
+ # warning about ignored side effects which we don't care about.
+ #
+ enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-Wno-assume")
endif()
} /*namespace deal_II_exceptions*/
+#if defined(__clang__)
+# define DEAL_II_ASSUME(expr) __builtin_assume(static_cast<bool>(expr))
+#elif defined(__GNUC__) && !defined(__ICC)
+# if __GNUC__ >= 13
+# define DEAL_II_ASSUME(expr) \
+ do \
+ { \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") \
+ [[assume(expr)]]; \
+ _Pragma("GCC diagnostic pop") \
+ } \
+ while (false)
+# else
+/* no way with GCC to express this without evaluating 'expr' */
+# define DEAL_II_ASSUME(expr) \
+ do \
+ { \
+ } \
+ while (false)
+# endif
+#elif defined(_MSC_VER) || defined(__ICC)
+# define DEAL_II_ASSUME(expr) __assume(expr);
+#else
+# define DEAL_II_ASSUME(expr) \
+ do \
+ { \
+ } \
+ while (false)
+#endif
+
/**
* A macro that serves as the main routine in the exception mechanism for debug
# endif /*ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/
# endif /*KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/
#else /*ifdef DEBUG*/
-# define Assert(cond, exc) \
- do \
- { \
- } \
- while (false)
+# define Assert(cond, exc) DEAL_II_ASSUME(cond)
#endif /*ifdef DEBUG*/
while (false)
# endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
#else
-# define AssertNothrow(cond, exc) \
- do \
- { \
- } \
- while (false)
+# define AssertNothrow(cond, exc) DEAL_II_ASSUME(cond)
#endif
/**
}
unsigned int j_indices[dim];
internal::FE_Q_Base::zero_indices<dim>(j_indices);
-# ifdef DEBUG
double sum_check = 0;
-# endif
for (unsigned int j = 0; j < q_dofs_per_cell; j += dofs1d)
{
double val_extra_dim = 1.;
my_restriction(mother_dof, child_dof) = 1.;
else if (std::fabs(val) > eps)
my_restriction(mother_dof, child_dof) = val;
-# ifdef DEBUG
sum_check += val;
-# endif
}
internal::FE_Q_Base::increment_indices<dim>(j_indices,
dofs1d);
// above, so they are here (unless they are in the interior). Use
// this to assign boundary indicators, but also make sure that we
// encounter exactly 48 such faces
-# ifdef DEBUG
unsigned int count = 0;
-# endif
for (const auto &cell : tria.cell_iterators())
if (cell->face(5)->at_boundary())
{
cell->face(5)->set_all_boundary_ids(1);
-# ifdef DEBUG
++count;
-# endif
}
Assert(count == 48, ExcInternalError());
}