aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Rasmus Munk Larsen <rmlarsen@google.com>2019-08-30 14:03:29 -0700
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2019-08-30 14:03:29 -0700
commitf6c51d9209ccc04d28c39f4c8059e7d3e74d6e07 (patch)
tree7d28a815d307368a6175b9ed6dc5f78df00bf684
parentbc40d4522c56fdf861fcdab28f4b7db609d8065e (diff)
Fix missing header inclusion and colliding definitions for half type casting, which broke
build with -march=native on Haswell/Skylake.
-rw-r--r--Eigen/Core1
-rw-r--r--Eigen/src/Core/arch/AVX/TypeCasting.h3
-rw-r--r--Eigen/src/Core/arch/AVX512/TypeCasting.h22
3 files changed, 26 insertions, 0 deletions
diff --git a/Eigen/Core b/Eigen/Core
index e6e31caee..9d8f8fce8 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -172,6 +172,7 @@ using std::ptrdiff_t;
#include "src/Core/arch/AVX/TypeCasting.h"
#include "src/Core/arch/AVX/Complex.h"
#include "src/Core/arch/AVX512/PacketMath.h"
+ #include "src/Core/arch/AVX512/TypeCasting.h"
#include "src/Core/arch/AVX512/Complex.h"
#include "src/Core/arch/SSE/MathFunctions.h"
#include "src/Core/arch/AVX/MathFunctions.h"
diff --git a/Eigen/src/Core/arch/AVX/TypeCasting.h b/Eigen/src/Core/arch/AVX/TypeCasting.h
index 910fc06ca..181043588 100644
--- a/Eigen/src/Core/arch/AVX/TypeCasting.h
+++ b/Eigen/src/Core/arch/AVX/TypeCasting.h
@@ -52,6 +52,7 @@ template<> EIGEN_STRONG_INLINE Packet8f preinterpret<Packet8f,Packet8i>(const Pa
return _mm256_castsi256_ps(a);
}
+#ifndef EIGEN_VECTORIZE_AVX512
template <>
struct type_casting_traits<Eigen::half, float> {
@@ -75,6 +76,8 @@ struct type_casting_traits<float, Eigen::half> {
};
};
+#endif // EIGEN_VECTORIZE_AVX512
+
template<> EIGEN_STRONG_INLINE Packet8h pcast<Packet8f, Packet8h>(const Packet8f& a) {
return float2half(a);
}
diff --git a/Eigen/src/Core/arch/AVX512/TypeCasting.h b/Eigen/src/Core/arch/AVX512/TypeCasting.h
index 777a26ae4..a82176941 100644
--- a/Eigen/src/Core/arch/AVX512/TypeCasting.h
+++ b/Eigen/src/Core/arch/AVX512/TypeCasting.h
@@ -1,3 +1,19 @@
+// This file is part of Eigen, a lightweight C++ template library
+// for linear algebra.
+//
+// Copyright (C) 2019 Rasmus Munk Larsen <rmlarsen@google.com>
+//
+// This Source Code Form is subject to the terms of the Mozilla
+// Public License v. 2.0. If a copy of the MPL was not distributed
+// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef EIGEN_TYPE_CASTING_AVX512_H
+#define EIGEN_TYPE_CASTING_AVX512_H
+
+namespace Eigen {
+
+namespace internal {
+
template <>
struct type_casting_traits<half, float> {
enum {
@@ -23,3 +39,9 @@ struct type_casting_traits<float, half> {
template<> EIGEN_STRONG_INLINE Packet16h pcast<Packet16f, Packet16h>(const Packet16f& a) {
return float2half(a);
}
+
+} // end namespace internal
+
+} // end namespace Eigen
+
+#endif // EIGEN_TYPE_CASTING_AVX512_H