2011-02-22 23:05:41 +08:00
# ifndef EIGEN_WARNINGS_DISABLED
# define EIGEN_WARNINGS_DISABLED
2022-02-16 02:03:03 +08:00
# if defined(_MSC_VER)
2009-12-12 21:49:43 +08:00
// 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
2009-12-14 17:32:43 +08:00
// 4101 - unreferenced local variable
2021-09-04 02:07:18 +08:00
// 4127 - conditional expression is constant
2010-06-25 19:31:07 +08:00
// 4181 - qualifier applied to reference type ignored
// 4211 - nonstandard extension used : redefined extern to static
// 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
// 4273 - QtAlignedMalloc, inconsistent DLL linkage
2010-06-09 02:21:55 +08:00
// 4324 - structure was padded due to declspec(align())
2015-11-23 22:03:24 +08:00
// 4503 - decorated name length exceeded, name was truncated
2009-12-14 17:32:43 +08:00
// 4512 - assignment operator could not be generated
2010-06-25 19:31:07 +08:00
// 4522 - 'class' : multiple assignment operators specified
2011-02-13 01:48:57 +08:00
// 4700 - uninitialized local variable 'xyz' used
2016-09-25 20:25:47 +08:00
// 4714 - function marked as __forceinline not inlined
2010-06-25 19:31:07 +08:00
// 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
2016-01-28 19:14:16 +08:00
// 4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
2011-02-22 23:05:41 +08:00
# ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
# pragma warning( push )
# endif
2021-09-04 02:07:18 +08:00
# pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800)
2023-10-24 01:56:04 +08:00
// We currently rely on has_denorm in tests, and need it defined correctly for half/bfloat16.
# ifndef _SILENCE_CXX23_DENORM_DEPRECATION_WARNING
# define EIGEN_REENABLE_CXX23_DENORM_DEPRECATION_WARNING 1
# define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING
# endif
2016-02-04 04:51:19 +08:00
2011-02-22 22:31:22 +08:00
# elif defined __INTEL_COMPILER
// 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
// ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
2011-02-22 23:05:41 +08:00
// typedef that may be a reference type.
2011-03-07 08:06:44 +08:00
// 279 - controlling expression is constant
// ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
2015-12-11 17:55:07 +08:00
// 1684 - conversion from pointer to same-sized integral type (potential portability problem)
// 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
2011-02-22 23:05:41 +08:00
# ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
# pragma warning push
# endif
2015-12-11 17:55:07 +08:00
# pragma warning disable 2196 279 1684 2259
2016-02-04 04:51:19 +08:00
2011-02-28 09:18:03 +08:00
# elif defined __clang__
# ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
# pragma clang diagnostic push
# endif
2022-01-21 08:27:43 +08:00
# if defined(__has_warning)
// -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
// this is really a stupid warning as it warns on compile-time expressions involving enums
# if __has_warning("-Wconstant-logical-operand")
# pragma clang diagnostic ignored "-Wconstant-logical-operand"
# endif
# if __has_warning("-Wimplicit-int-float-conversion")
# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
# endif
2023-03-16 00:50:46 +08:00
# if ( defined(__ALTIVEC__) || defined(__VSX__) ) && ( !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L) )
2022-01-21 08:27:43 +08:00
// warning: generic selections are a C11-specific feature
// ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
# if __has_warning("-Wc11-extensions")
# pragma clang diagnostic ignored "-Wc11-extensions"
# endif
# endif
2019-08-10 05:56:26 +08:00
# endif
2016-05-19 21:21:53 +08:00
2022-01-08 02:46:16 +08:00
# elif defined __GNUC__ && !defined(__FUJITSU)
2016-05-19 21:21:53 +08:00
2018-09-27 15:28:57 +08:00
# if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2016-05-19 21:21:53 +08:00
# pragma GCC diagnostic push
# endif
2018-04-22 04:08:26 +08:00
// g++ warns about local variables shadowing member functions, which is too strict
# pragma GCC diagnostic ignored "-Wshadow"
2018-09-12 20:40:39 +08:00
# if __GNUC__ == 4 && __GNUC_MINOR__ < 8
// Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
# pragma GCC diagnostic ignored "-Wtype-limits"
# endif
2018-04-22 04:08:26 +08:00
# if __GNUC__>=6
# pragma GCC diagnostic ignored "-Wignored-attributes"
# endif
2019-06-14 20:57:46 +08:00
# if __GNUC__==7
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
# pragma GCC diagnostic ignored "-Wattributes"
# endif
2016-02-10 12:55:50 +08:00
# endif
2016-02-04 04:51:19 +08:00
2016-02-10 12:55:50 +08:00
# if defined __NVCC__
2022-02-16 02:03:03 +08:00
// MSVC 14.16 (required by CUDA 9.*) does not support the _Pragma keyword, so
// we instead use Microsoft's __pragma extension.
# if defined _MSC_VER
# define EIGEN_MAKE_PRAGMA(X) __pragma(#X)
# else
# define EIGEN_MAKE_PRAGMA(X) _Pragma(#X)
# endif
2021-08-27 00:34:31 +08:00
# if defined __NVCC_DIAG_PRAGMA_SUPPORT__
# define EIGEN_NV_DIAG_SUPPRESS(X) EIGEN_MAKE_PRAGMA(nv_diag_suppress X)
# else
# define EIGEN_NV_DIAG_SUPPRESS(X) EIGEN_MAKE_PRAGMA(diag_suppress X)
# endif
EIGEN_NV_DIAG_SUPPRESS ( boolean_controlling_expr_is_constant )
2016-02-04 06:12:18 +08:00
// Disable the "statement is unreachable" message
2021-08-27 00:34:31 +08:00
EIGEN_NV_DIAG_SUPPRESS ( code_is_unreachable )
2016-02-04 06:12:18 +08:00
// Disable the "dynamic initialization in unreachable code" message
2021-08-27 00:34:31 +08:00
EIGEN_NV_DIAG_SUPPRESS ( initialization_not_reachable )
2016-09-14 03:49:40 +08:00
// Disable the "invalid error number" message that we get with older versions of nvcc
2021-08-27 00:34:31 +08:00
EIGEN_NV_DIAG_SUPPRESS ( 1222 )
2016-09-14 03:49:40 +08:00
// Disable the "calling a __host__ function from a __host__ __device__ function is not allowed" messages (yes, there are many of them and they seem to change with every version of the compiler)
2021-08-27 00:34:31 +08:00
EIGEN_NV_DIAG_SUPPRESS ( 2527 )
EIGEN_NV_DIAG_SUPPRESS ( 2529 )
EIGEN_NV_DIAG_SUPPRESS ( 2651 )
EIGEN_NV_DIAG_SUPPRESS ( 2653 )
EIGEN_NV_DIAG_SUPPRESS ( 2668 )
EIGEN_NV_DIAG_SUPPRESS ( 2669 )
EIGEN_NV_DIAG_SUPPRESS ( 2670 )
EIGEN_NV_DIAG_SUPPRESS ( 2671 )
EIGEN_NV_DIAG_SUPPRESS ( 2735 )
EIGEN_NV_DIAG_SUPPRESS ( 2737 )
EIGEN_NV_DIAG_SUPPRESS ( 2739 )
EIGEN_NV_DIAG_SUPPRESS ( 2885 )
EIGEN_NV_DIAG_SUPPRESS ( 2888 )
EIGEN_NV_DIAG_SUPPRESS ( 2976 )
EIGEN_NV_DIAG_SUPPRESS ( 2979 )
EIGEN_NV_DIAG_SUPPRESS ( 20011 )
EIGEN_NV_DIAG_SUPPRESS ( 20014 )
2021-09-24 01:49:08 +08:00
// Disable the "// __device__ annotation is ignored on a function(...) that is
// explicitly defaulted on its first declaration" message.
// The __device__ annotation seems to actually be needed in some cases,
// otherwise resulting in kernel runtime errors.
2021-08-27 00:34:31 +08:00
EIGEN_NV_DIAG_SUPPRESS ( 2886 )
2023-02-04 03:18:45 +08:00
EIGEN_NV_DIAG_SUPPRESS ( 2929 )
2021-08-27 00:34:31 +08:00
EIGEN_NV_DIAG_SUPPRESS ( 2977 )
EIGEN_NV_DIAG_SUPPRESS ( 20012 )
# undef EIGEN_NV_DIAG_SUPPRESS
# undef EIGEN_MAKE_PRAGMA
2011-02-22 23:05:41 +08:00
# endif
2018-08-29 00:26:22 +08:00
# else
// warnings already disabled:
# ifndef EIGEN_WARNINGS_DISABLED_2
# define EIGEN_WARNINGS_DISABLED_2
# elif defined(EIGEN_INTERNAL_DEBUGGING)
# error "Do not include \"DisableStupidWarnings.h\" recursively more than twice!"
# endif
2011-02-22 23:05:41 +08:00
# endif // not EIGEN_WARNINGS_DISABLED