diff options
author | 2019-08-27 11:30:31 -0700 | |
---|---|---|
committer | 2019-08-27 11:30:31 -0700 | |
commit | b021cdea6dd84b0f51dd7aea691d47dd3eab8e9d (patch) | |
tree | fe710bcd0723cd3885e9d832cb78f6b25bda1df9 /Eigen/src/Core/arch/AVX512/TypeCasting.h | |
parent | 84fefdf32155f9bbba403b44c961c437eaeac993 (diff) |
Clean up float16 a.k.a. Eigen::half support in Eigen. Move the definition of half to Core/arch/Default and move arch-specific packet ops to their respective sub-directories.
Diffstat (limited to 'Eigen/src/Core/arch/AVX512/TypeCasting.h')
-rw-r--r-- | Eigen/src/Core/arch/AVX512/TypeCasting.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/AVX512/TypeCasting.h b/Eigen/src/Core/arch/AVX512/TypeCasting.h new file mode 100644 index 000000000..777a26ae4 --- /dev/null +++ b/Eigen/src/Core/arch/AVX512/TypeCasting.h @@ -0,0 +1,25 @@ +template <> +struct type_casting_traits<half, float> { + enum { + VectorizedCast = 1, + SrcCoeffRatio = 1, + TgtCoeffRatio = 1 + }; +}; + +template<> EIGEN_STRONG_INLINE Packet16f pcast<Packet16h, Packet16f>(const Packet16h& a) { + return half2float(a); +} + +template <> +struct type_casting_traits<float, half> { + enum { + VectorizedCast = 1, + SrcCoeffRatio = 1, + TgtCoeffRatio = 1 + }; +}; + +template<> EIGEN_STRONG_INLINE Packet16h pcast<Packet16f, Packet16h>(const Packet16f& a) { + return float2half(a); +} |