diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2019-08-30 14:03:29 -0700 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2019-08-30 14:03:29 -0700 |
commit | f6c51d9209ccc04d28c39f4c8059e7d3e74d6e07 (patch) | |
tree | 7d28a815d307368a6175b9ed6dc5f78df00bf684 /Eigen/src/Core/arch | |
parent | bc40d4522c56fdf861fcdab28f4b7db609d8065e (diff) |
Fix missing header inclusion and colliding definitions for half type casting, which broke
build with -march=native on Haswell/Skylake.
Diffstat (limited to 'Eigen/src/Core/arch')
-rw-r--r-- | Eigen/src/Core/arch/AVX/TypeCasting.h | 3 | ||||
-rw-r--r-- | Eigen/src/Core/arch/AVX512/TypeCasting.h | 22 |
2 files changed, 25 insertions, 0 deletions
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 |