mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Fix AVX512 math function consistency, enable for ICC.
This commit is contained in:
parent
cafeadffef
commit
96da541cba
@ -17,7 +17,8 @@ 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
|
||||
#if EIGEN_GNUC_AT_LEAST(5, 3) || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC >= 1923 || EIGEN_COMP_ICC >= 1900
|
||||
#define EIGEN_HAS_AVX512_MATH 1
|
||||
|
||||
#define EIGEN_DECLARE_CONST_Packet16f(NAME, X) \
|
||||
const Packet16f p16f_##NAME = pset1<Packet16f>(X)
|
||||
@ -326,7 +327,9 @@ Packet16f pexpm1<Packet16f>(const Packet16f& _x) {
|
||||
F16_PACKET_FUNCTION(Packet16f, Packet16h, pexpm1)
|
||||
BF16_PACKET_FUNCTION(Packet16f, Packet16bf, pexpm1)
|
||||
|
||||
#endif
|
||||
#else
|
||||
#define EIGEN_HAS_AVX512_MATH 0
|
||||
#endif // EIGEN_HAS_AVX512_MATH
|
||||
|
||||
|
||||
template <>
|
||||
|
@ -74,12 +74,14 @@ struct packet_traits<half> : default_packet_traits {
|
||||
HasMax = 1,
|
||||
HasConj = 1,
|
||||
HasSetLinear = 0,
|
||||
HasLog = 1,
|
||||
HasLog1p = 1,
|
||||
HasExpm1 = 1,
|
||||
HasExp = 1,
|
||||
HasSqrt = 1,
|
||||
HasRsqrt = 1,
|
||||
HasLog = EIGEN_HAS_AVX512_MATH,
|
||||
HasLog1p = EIGEN_HAS_AVX512_MATH,
|
||||
HasExp = EIGEN_HAS_AVX512_MATH,
|
||||
HasExpm1 = EIGEN_HAS_AVX512_MATH,
|
||||
HasSqrt = EIGEN_HAS_AVX512_MATH,
|
||||
HasRsqrt = EIGEN_HAS_AVX512_MATH,
|
||||
HasBessel = EIGEN_HAS_AVX512_MATH,
|
||||
HasNdtri = EIGEN_HAS_AVX512_MATH,
|
||||
HasSin = EIGEN_FAST_MATH,
|
||||
HasCos = EIGEN_FAST_MATH,
|
||||
HasTanh = EIGEN_FAST_MATH,
|
||||
@ -88,9 +90,7 @@ struct packet_traits<half> : default_packet_traits {
|
||||
HasRound = 1,
|
||||
HasFloor = 1,
|
||||
HasCeil = 1,
|
||||
HasRint = 1,
|
||||
HasBessel = 1,
|
||||
HasNdtri = 1
|
||||
HasRint = 1
|
||||
};
|
||||
};
|
||||
|
||||
@ -111,7 +111,7 @@ template<> struct packet_traits<float> : default_packet_traits
|
||||
HasBlend = 0,
|
||||
HasSin = EIGEN_FAST_MATH,
|
||||
HasCos = EIGEN_FAST_MATH,
|
||||
#if EIGEN_GNUC_AT_LEAST(5, 3) || (!EIGEN_COMP_GNUC_STRICT)
|
||||
#if EIGEN_HAS_AVX512_MATH
|
||||
HasLog = 1,
|
||||
HasLog1p = 1,
|
||||
HasExpm1 = 1,
|
||||
@ -141,7 +141,7 @@ template<> struct packet_traits<double> : default_packet_traits
|
||||
AlignedOnScalar = 1,
|
||||
size = 8,
|
||||
HasHalfPacket = 1,
|
||||
#if EIGEN_GNUC_AT_LEAST(5, 3) || (!EIGEN_COMP_GNUC_STRICT)
|
||||
#if EIGEN_HAS_AVX512_MATH
|
||||
HasLog = 1,
|
||||
HasExp = 1,
|
||||
HasSqrt = EIGEN_FAST_MATH,
|
||||
@ -2175,7 +2175,7 @@ struct packet_traits<bfloat16> : default_packet_traits {
|
||||
HasInsert = 1,
|
||||
HasSin = EIGEN_FAST_MATH,
|
||||
HasCos = EIGEN_FAST_MATH,
|
||||
#if EIGEN_GNUC_AT_LEAST(5, 3) || (!EIGEN_COMP_GNUC_STRICT)
|
||||
#if EIGEN_HAS_AVX512_MATH
|
||||
#ifdef EIGEN_VECTORIZE_AVX512DQ
|
||||
HasLog = 1, // Currently fails test with bad accuracy.
|
||||
HasLog1p = 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user