Define EIGEN_HAS_AVX512_MATH in PacketMath.

(cherry picked from commit e7f4a901ee8cbe42d37bcabefb342086235c3839)
This commit is contained in:
Antonio Sánchez 2022-02-04 22:25:52 +00:00 committed by Antonio Sanchez
parent 77b2807322
commit 730a781221
2 changed files with 8 additions and 5 deletions

View File

@ -14,9 +14,7 @@ namespace Eigen {
namespace internal {
// Disable the code for older versions of gcc that don't support many of the required avx512 instrinsics.
#if EIGEN_GNUC_AT_LEAST(5, 3) || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC >= 1923 || EIGEN_COMP_ICC >= 1900
#define EIGEN_HAS_AVX512_MATH 1
#if EIGEN_HAS_AVX512_MATH
#define _EIGEN_DECLARE_CONST_Packet16f(NAME, X) \
const Packet16f p16f_##NAME = pset1<Packet16f>(X)
@ -327,8 +325,6 @@ Packet16f pexpm1<Packet16f>(const Packet16f& _x) {
F16_PACKET_FUNCTION(Packet16f, Packet16h, pexpm1)
BF16_PACKET_FUNCTION(Packet16f, Packet16bf, pexpm1)
#else
#define EIGEN_HAS_AVX512_MATH 0
#endif // EIGEN_HAS_AVX512_MATH

View File

@ -28,6 +28,13 @@ namespace internal {
#endif
#endif
// Disable the code for older versions of gcc that don't support many of the required avx512 math instrinsics.
#if EIGEN_GNUC_AT_LEAST(5, 3) || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC >= 1923 || EIGEN_COMP_ICC >= 1900
#define EIGEN_HAS_AVX512_MATH 1
#else
#define EIGEN_HAS_AVX512_MATH 0
#endif
typedef __m512 Packet16f;
typedef __m512i Packet16i;
typedef __m512d Packet8d;