Disable FPE for SYCL builds
[alexxy/gromacs.git] / api / legacy / include / gromacs / math / utilities.h
index 5ff601d97cdfff969b386ae520fca04ec89be1fe..b0647ddfe8b5a9676fdf632c863a1107a8d8a390 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -157,4 +157,19 @@ int gmx_feenableexcept();
  */
 int gmx_fedisableexcept();
 
+/*! \brief Return true if the current build should enable floating-point exceptions by default.
+ *
+ * Currently, it returns true unless any of the following conditions are met:
+ * - release build,
+ * - SYCL build (Intel IGC, at least 1.0.5964, raises FP exceptions in JIT compilation),
+ * - - See https://github.com/intel/intel-graphics-compiler/issues/164
+ * - compilers with known buggy FP exception support (clang with any optimization)
+ *   or suspected buggy FP exception support (gcc 7.* with optimization).
+ *
+ * Note that this function does not check whether the build/OS supports FP exceptions.
+ *
+ * \returns true if we should enable FP exceptions by default.
+ */
+bool gmxShouldEnableFPExceptions();
+
 #endif