AVX/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) 2015 Benoit Steiner <benoit.steiner.goog@gmail.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_AVX_H
11 #define EIGEN_TYPE_CASTING_AVX_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16 
17 // For now we use SSE to handle integers, so we can't use AVX instructions to cast
18 // from int to float
19 template <>
20 struct type_casting_traits<float, int> {
21  enum {
22  VectorizedCast = 0,
23  SrcCoeffRatio = 1,
24  TgtCoeffRatio = 1
25  };
26 };
27 
28 template <>
29 struct type_casting_traits<int, float> {
30  enum {
31  VectorizedCast = 0,
32  SrcCoeffRatio = 1,
33  TgtCoeffRatio = 1
34  };
35 };
36 
37 
38 #ifndef EIGEN_VECTORIZE_AVX512
39 
40 template <>
42  enum {
46  };
47 };
48 
49 
50 template <>
52  enum {
56  };
57 };
58 
59 template <>
61  enum {
65  };
66 };
67 
68 template <>
70  enum {
74  };
75 };
76 
77 #endif // EIGEN_VECTORIZE_AVX512
78 
80  return _mm256_cvttps_epi32(a);
81 }
82 
84  return _mm256_cvtepi32_ps(a);
85 }
86 
88  return _mm256_castps_si256(a);
89 }
90 
92  return _mm256_castsi256_ps(a);
93 }
94 
96  return half2float(a);
97 }
98 
100  return Bf16ToF32(a);
101 }
102 
104  return float2half(a);
105 }
106 
108  return F32ToBf16(a);
109 }
110 
111 } // end namespace internal
112 
113 } // end namespace Eigen
114 
115 #endif // EIGEN_TYPE_CASTING_AVX_H
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
Eigen::internal::eigen_packet_wrapper
Definition: GenericPacketMath.h:159
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::pcast< Packet8h, Packet8f >
EIGEN_STRONG_INLINE Packet8f pcast< Packet8h, Packet8f >(const Packet8h &a)
Definition: AVX/TypeCasting.h:95
Eigen::internal::pcast< Packet8i, Packet8f >
EIGEN_STRONG_INLINE Packet8f pcast< Packet8i, Packet8f >(const Packet8i &a)
Definition: AVX/TypeCasting.h:83
Eigen::bfloat16
Definition: BFloat16.h:58
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< Packet8f, Packet8bf >
EIGEN_STRONG_INLINE Packet8bf pcast< Packet8f, Packet8bf >(const Packet8f &a)
Definition: AVX/TypeCasting.h:107
Eigen::internal::Packet8i
__m256i Packet8i
Definition: AVX/PacketMath.h:32
Eigen::internal::type_casting_traits::SrcCoeffRatio
@ SrcCoeffRatio
Definition: GenericPacketMath.h:151
Eigen::internal::pcast< Packet8f, Packet8i >
EIGEN_STRONG_INLINE Packet8i pcast< Packet8f, Packet8i >(const Packet8f &a)
Definition: AVX/TypeCasting.h:79
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::pcast< Packet8f, Packet8h >
EIGEN_STRONG_INLINE Packet8h pcast< Packet8f, Packet8h >(const Packet8f &a)
Definition: AVX/TypeCasting.h:103
Eigen::internal::preinterpret< Packet8i, Packet8f >
EIGEN_STRONG_INLINE Packet8i preinterpret< Packet8i, Packet8f >(const Packet8f &a)
Definition: AVX/TypeCasting.h:87
Eigen::internal::type_casting_traits
Definition: GenericPacketMath.h:148
Eigen::internal::type_casting_traits::TgtCoeffRatio
@ TgtCoeffRatio
Definition: GenericPacketMath.h:152
Eigen::internal::preinterpret< Packet8f, Packet8i >
EIGEN_STRONG_INLINE Packet8f preinterpret< Packet8f, Packet8i >(const Packet8i &a)
Definition: AVX/TypeCasting.h:91
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::Packet8f
__m256 Packet8f
Definition: AVX/PacketMath.h:31
Eigen::internal::pcast< Packet8bf, Packet8f >
EIGEN_STRONG_INLINE Packet8f pcast< Packet8bf, Packet8f >(const Packet8bf &a)
Definition: AVX/TypeCasting.h:99


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