Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.3.8
AVX/TypeCasting.h
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 
39 template<> EIGEN_STRONG_INLINE Packet8i pcast<Packet8f, Packet8i>(const Packet8f& a) {
40  return _mm256_cvtps_epi32(a);
41 }
42 
43 template<> EIGEN_STRONG_INLINE Packet8f pcast<Packet8i, Packet8f>(const Packet8i& a) {
44  return _mm256_cvtepi32_ps(a);
45 }
46 
47 } // end namespace internal
48 
49 } // end namespace Eigen
50 
51 #endif // EIGEN_TYPE_CASTING_AVX_H
Eigen
Namespace containing all symbols from the Eigen library.
Definition: Core:309
Eigen::DenseBase::rowwise
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:504
Eigen::DenseBase::Random
static const RandomReturnType Random()
Definition: Random.h:113
Eigen::PlainObjectBase::setZero
Derived & setZero(Index size)
Definition: CwiseNullaryOp.h:515
Eigen::MatrixBase::cos
const MatrixFunctionReturnValue< Derived > cos() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise cosine...
Eigen::VectorwiseOp::sum
const SumReturnType sum() const
Definition: VectorwiseOp.h:398
Eigen::DenseBase::sum
Scalar sum() const
Definition: Redux.h:449
Eigen::DenseBase::colwise
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:516
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
Eigen::MatrixBase::Identity
static const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:700
Eigen::MatrixBase::diagonal
DiagonalReturnType diagonal()
Definition: Diagonal.h:191
Eigen::MatrixBase::setIdentity
Derived & setIdentity()
Definition: CwiseNullaryOp.h:774
Eigen::DenseBase::transpose
TransposeReturnType transpose()
Definition: Transpose.h:174