AVX512/TypeCasting.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2019 Rasmus Munk Larsen <rmlarsen@google.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_TYPE_CASTING_AVX512_H
11 #define EIGEN_TYPE_CASTING_AVX512_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16 
18  return _mm512_cvttps_epi32(a);
19 }
20 
22  return _mm512_cvtepi32_ps(a);
23 }
24 
26  return _mm512_castps_si512(a);
27 }
28 
30  return _mm512_castsi512_ps(a);
31 }
32 
33 template <>
35  enum {
39  };
40 };
41 
43  return half2float(a);
44 }
45 
46 template <>
48  enum {
52  };
53 };
54 
56  return float2half(a);
57 }
58 
59 template <>
60 struct type_casting_traits<bfloat16, float> {
61  enum {
62  VectorizedCast = 1,
63  SrcCoeffRatio = 1,
64  TgtCoeffRatio = 1
65  };
66 };
67 
69  return Bf16ToF32(a);
70 }
71 
72 template <>
73 struct type_casting_traits<float, bfloat16> {
74  enum {
75  VectorizedCast = 1,
76  SrcCoeffRatio = 1,
77  TgtCoeffRatio = 1
78  };
79 };
80 
82  return F32ToBf16(a);
83 }
84 
85 } // end namespace internal
86 
87 } // end namespace Eigen
88 
89 #endif // EIGEN_TYPE_CASTING_AVX512_H
EIGEN_STRONG_INLINE Packet8f half2float(const Packet8h &a)
EIGEN_STRONG_INLINE Packet8f Bf16ToF32(const Packet8bf &a)
EIGEN_STRONG_INLINE Packet8bf F32ToBf16(Packet4f p4f)
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
EIGEN_STRONG_INLINE Packet16f preinterpret< Packet16f, Packet16i >(const Packet16i &a)
EIGEN_STRONG_INLINE Packet16f pcast< Packet16h, Packet16f >(const Packet16h &a)
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
EIGEN_STRONG_INLINE Packet16bf pcast< Packet16f, Packet16bf >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet16f pcast< Packet16bf, Packet16f >(const Packet16bf &a)
EIGEN_STRONG_INLINE Packet16i preinterpret< Packet16i, Packet16f >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet16h pcast< Packet16f, Packet16h >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet8h float2half(const Packet8f &a)
EIGEN_STRONG_INLINE Packet16f pcast< Packet16i, Packet16f >(const Packet16i &a)
EIGEN_STRONG_INLINE Packet16i pcast< Packet16f, Packet16i >(const Packet16f &a)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:40:38