#ifdef DEBUG
# if KOKKOS_VERSION >= 30600
# ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-# define Assert(cond, exc) \
- { \
- KOKKOS_IF_ON_HOST(({ \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
- abort_or_throw_on_exception, \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #cond, \
- #exc, \
- exc); \
- })) \
- KOKKOS_IF_ON_DEVICE(({ \
- if (!(cond)) \
- Kokkos::abort(#cond); \
- })) \
- }
+# define Assert(cond, exc) \
+ do \
+ { \
+ KOKKOS_IF_ON_HOST(({ \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
+ abort_or_throw_on_exception, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #cond, \
+ #exc, \
+ exc); \
+ })) \
+ KOKKOS_IF_ON_DEVICE(({ \
+ if (!(cond)) \
+ Kokkos::abort(#cond); \
+ })) \
+ } \
+ while (0)
# else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-# define Assert(cond, exc) \
- { \
- KOKKOS_IF_ON_HOST(({ \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
- abort_or_throw_on_exception, \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #cond, \
- #exc, \
- exc); \
- })) \
- KOKKOS_IF_ON_DEVICE(({ \
- if (!(cond)) \
- Kokkos::abort(#cond); \
- })) \
- }
+# define Assert(cond, exc) \
+ do \
+ { \
+ KOKKOS_IF_ON_HOST(({ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
+ abort_or_throw_on_exception, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #cond, \
+ #exc, \
+ exc); \
+ })) \
+ KOKKOS_IF_ON_DEVICE(({ \
+ if (!(cond)) \
+ Kokkos::abort(#cond); \
+ })) \
+ } \
+ while (0)
# endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
# else /*if KOKKOS_VERSION >= 30600*/
# ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
# ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-# define Assert(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
- abort_or_throw_on_exception, \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #cond, \
- #exc, \
- exc); \
- }
+# define Assert(cond, exc) \
+ do \
+ { \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
+ abort_or_throw_on_exception, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #cond, \
+ #exc, \
+ exc); \
+ } \
+ while (0)
# else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-# define Assert(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
- abort_or_throw_on_exception, \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #cond, \
- #exc, \
- exc); \
- }
+# define Assert(cond, exc) \
+ do \
+ { \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
+ abort_or_throw_on_exception, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #cond, \
+ #exc, \
+ exc); \
+ } \
+ while (0)
# endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
# else /*#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/
-# define Assert(cond, exc) \
- { \
- if (!(cond)) \
- Kokkos::abort(#cond); \
- }
+# define Assert(cond, exc) \
+ do \
+ { \
+ if (!(cond)) \
+ Kokkos::abort(#cond); \
+ } \
+ while (0)
# endif /*ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/
# endif /*KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/
#else /*ifdef DEBUG*/
# define Assert(cond, exc) \
- {}
+ do \
+ { \
+ } \
+ while (0)
#endif /*ifdef DEBUG*/
*/
#ifdef DEBUG
# ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-# define AssertNothrow(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+# define AssertNothrow(cond, exc) \
+ do \
+ { \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+ } \
+ while (0)
# else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-# define AssertNothrow(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+# define AssertNothrow(cond, exc) \
+ do \
+ { \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+ } \
+ while (0)
# endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
#else
# define AssertNothrow(cond, exc) \
- {}
+ do \
+ { \
+ } \
+ while (0)
#endif
/**
* @ingroup Exceptions
*/
#ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-# define AssertThrow(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
- throw_on_exception, \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #cond, \
- #exc, \
- exc); \
- }
+# define AssertThrow(cond, exc) \
+ do \
+ { \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
+ throw_on_exception, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #cond, \
+ #exc, \
+ exc); \
+ } \
+ while (0)
#else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-# define AssertThrow(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
- throw_on_exception, \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #cond, \
- #exc, \
- exc); \
- }
+# define AssertThrow(cond, exc) \
+ do \
+ { \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
+ throw_on_exception, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #cond, \
+ #exc, \
+ exc); \
+ } \
+ while (0)
#endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
AssertThrow(error_code == MPI_SUCCESS, dealii::ExcMPI(error_code))
#else
# define AssertThrowMPI(error_code) \
- {}
+ do \
+ { \
+ } \
+ while (0)
#endif // DEAL_II_WITH_MPI
#ifdef DEAL_II_WITH_CUDA
dealii::ExcCudaError(cudaGetErrorString(error_code)))
# else
# define AssertCuda(error_code) \
- { \
- (void)(error_code); \
- }
+ do \
+ { \
+ (void)(error_code); \
+ } \
+ while (0)
# endif
/**
dealii::ExcCudaError(cudaGetErrorString(error_code)))
# else
# define AssertNothrowCuda(error_code) \
- { \
- (void)(error_code); \
- }
+ do \
+ { \
+ (void)(error_code); \
+ } \
+ while (0)
# endif
/**
* @ingroup Exceptions
*/
# ifdef DEBUG
-# define AssertCudaKernel() \
- { \
- cudaError_t local_error_code = cudaPeekAtLastError(); \
- AssertCuda(local_error_code); \
- local_error_code = cudaDeviceSynchronize(); \
- AssertCuda(local_error_code) \
- }
+# define AssertCudaKernel() \
+ do \
+ { \
+ cudaError_t local_error_code = cudaPeekAtLastError(); \
+ AssertCuda(local_error_code); \
+ local_error_code = cudaDeviceSynchronize(); \
+ AssertCuda(local_error_code); \
+ } \
+ while (0)
# else
# define AssertCudaKernel() \
- {}
+ do \
+ { \
+ } \
+ while (0)
# endif
/**
error_code)))
# else
# define AssertCusparse(error_code) \
- { \
- (void)(error_code); \
- }
+ do \
+ { \
+ (void)(error_code); \
+ } \
+ while (0)
# endif
/**
error_code)))
# else
# define AssertNothrowCusparse(error_code) \
- { \
- (void)(error_code); \
- }
+ do \
+ { \
+ (void)(error_code); \
+ } \
+ while (0)
# endif
/**
error_code)))
# else
# define AssertCusolver(error_code) \
- { \
- (void)(error_code); \
- }
+ do \
+ { \
+ (void)(error_code); \
+ } \
+ while (0)
# endif
#endif