diff --git a/Eigen/src/Core/arch/AVX512/TrsmKernel.h b/Eigen/src/Core/arch/AVX512/TrsmKernel.h index 94f1f5a47..edd6ef3fd 100644 --- a/Eigen/src/Core/arch/AVX512/TrsmKernel.h +++ b/Eigen/src/Core/arch/AVX512/TrsmKernel.h @@ -28,12 +28,6 @@ #define EIGEN_USE_AVX512_TRSM_L_KERNELS 0 #endif -#if defined(EIGEN_HAS_CXX17_IFCONSTEXPR) -#define EIGEN_IF_CONSTEXPR(X) if constexpr (X) -#else -#define EIGEN_IF_CONSTEXPR(X) if (X) -#endif - // Need this for some std::min calls. #ifdef min #undef min diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 0b076510b..565e97d40 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -354,7 +354,7 @@ inline void computeProductBlockingSizes(Index& k, Index& m, Index& n, Index num_ template struct RhsPanelHelper { private: - static const int remaining_registers = EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS - registers_taken; + static constexpr int remaining_registers = (std::max)(int(EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS) - registers_taken, 0); public: typedef std::conditional_t=4, RhsPacketx4, RhsPacket> type; }; @@ -1221,6 +1221,7 @@ struct lhs_process_one_packet // (LhsProgress x depth) for(Index i=peelStart; i=8) { for(Index j2=0; j2= 8 + EIGEN_IF_CONSTEXPR(nr>=8) { for(Index j2=0; j2=8) { for(Index j2=0; j2=8) { // loop on each panel of the rhs for(Index j2=0; j2=8) + EIGEN_IF_CONSTEXPR(nr>=8) { for(Index j2=0; j2=4) + + EIGEN_IF_CONSTEXPR(nr>=4) { for(Index j2=packet_cols8; j2=8 ? (cols/8) * 8 : 0; Index packet_cols4 = nr>=4 ? (cols/4) * 4 : 0; Index count = 0; - - if(nr>=8) + EIGEN_IF_CONSTEXPR(nr>=8) { for(Index j2=0; j2