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::internal::eigen_packet_wrapper
Definition: GenericPacketMath.h:159
Eigen::internal::preinterpret< Packet16i, Packet16f >
EIGEN_STRONG_INLINE Packet16i preinterpret< Packet16i, Packet16f >(const Packet16f &a)
Definition: AVX512/TypeCasting.h:25
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::pcast< Packet16f, Packet16h >
EIGEN_STRONG_INLINE Packet16h pcast< Packet16f, Packet16h >(const Packet16f &a)
Definition: AVX512/TypeCasting.h:55
Eigen::internal::Packet16i
__m512i Packet16i
Definition: AVX512/PacketMath.h:32
Eigen::bfloat16
Definition: BFloat16.h:58
Eigen::internal::Packet16f
__m512 Packet16f
Definition: AVX512/PacketMath.h:31
Eigen::internal::pcast< Packet16h, Packet16f >
EIGEN_STRONG_INLINE Packet16f pcast< Packet16h, Packet16f >(const Packet16h &a)
Definition: AVX512/TypeCasting.h:42
Eigen::internal::preinterpret< Packet16f, Packet16i >
EIGEN_STRONG_INLINE Packet16f preinterpret< Packet16f, Packet16i >(const Packet16i &a)
Definition: AVX512/TypeCasting.h:29
Eigen::internal::F32ToBf16
EIGEN_STRONG_INLINE Packet8bf F32ToBf16(Packet4f p4f)
Definition: AltiVec/PacketMath.h:1252
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::internal::pcast< Packet16bf, Packet16f >
EIGEN_STRONG_INLINE Packet16f pcast< Packet16bf, Packet16f >(const Packet16bf &a)
Definition: AVX512/TypeCasting.h:68
Eigen::internal::type_casting_traits::SrcCoeffRatio
@ SrcCoeffRatio
Definition: GenericPacketMath.h:151
Eigen::internal::Bf16ToF32
EIGEN_STRONG_INLINE Packet8f Bf16ToF32(const Packet8bf &a)
Definition: AVX/PacketMath.h:1260
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::internal::type_casting_traits
Definition: GenericPacketMath.h:148
Eigen::internal::type_casting_traits::TgtCoeffRatio
@ TgtCoeffRatio
Definition: GenericPacketMath.h:152
Eigen::internal::half2float
EIGEN_STRONG_INLINE Packet8f half2float(const Packet8h &a)
Definition: AVX/PacketMath.h:988
gtsam.examples.DogLegOptimizerExample.float
float
Definition: DogLegOptimizerExample.py:113
internal
Definition: BandTriangularSolver.h:13
Eigen::internal::type_casting_traits::VectorizedCast
@ VectorizedCast
Definition: GenericPacketMath.h:150
Eigen::half
Definition: Half.h:142
Eigen::internal::float2half
EIGEN_STRONG_INLINE Packet8h float2half(const Packet8f &a)
Definition: AVX/PacketMath.h:1007
Eigen::internal::pcast< Packet16i, Packet16f >
EIGEN_STRONG_INLINE Packet16f pcast< Packet16i, Packet16f >(const Packet16i &a)
Definition: AVX512/TypeCasting.h:21
Eigen::internal::pcast< Packet16f, Packet16bf >
EIGEN_STRONG_INLINE Packet16bf pcast< Packet16f, Packet16bf >(const Packet16f &a)
Definition: AVX512/TypeCasting.h:81
Eigen::internal::pcast< Packet16f, Packet16i >
EIGEN_STRONG_INLINE Packet16i pcast< Packet16f, Packet16i >(const Packet16f &a)
Definition: AVX512/TypeCasting.h:17


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:37