diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index fc3a81c63..18cd96016 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -1403,8 +1403,7 @@ EIGEN_DONT_INLINE void gebp_kernel; diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index e76c74cca..b73f2ac8f 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -906,6 +906,18 @@ #define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE #endif +// EIGEN_LAMBDA_ALWAYS_INLINE forces inlining of lambda functions. +// On GCC/Clang, __attribute__((always_inline)) works on lambdas. +// On MSVC, __forceinline cannot be applied to lambdas, but the +// [[msvc::forceinline]] attribute (available since VS 2022 17.1) can. +#if EIGEN_COMP_GNUC && !defined(SYCL_DEVICE_ONLY) +#define EIGEN_LAMBDA_ALWAYS_INLINE __attribute__((always_inline)) +#elif EIGEN_COMP_MSVC >= 1931 +#define EIGEN_LAMBDA_ALWAYS_INLINE [[msvc::forceinline]] +#else +#define EIGEN_LAMBDA_ALWAYS_INLINE +#endif + #if EIGEN_COMP_GNUC #define EIGEN_DONT_INLINE __attribute__((noinline)) #elif EIGEN_COMP_MSVC