mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Merged eigen/eigen into default
This commit is contained in:
@@ -274,7 +274,8 @@ template<typename XprType> struct blas_traits
|
||||
HasUsableDirectAccess = ( (int(XprType::Flags)&DirectAccessBit)
|
||||
&& ( bool(XprType::IsVectorAtCompileTime)
|
||||
|| int(inner_stride_at_compile_time<XprType>::ret) == 1)
|
||||
) ? 1 : 0
|
||||
) ? 1 : 0,
|
||||
HasScalarFactor = false
|
||||
};
|
||||
typedef typename conditional<bool(HasUsableDirectAccess),
|
||||
ExtractType,
|
||||
@@ -306,6 +307,9 @@ template<typename Scalar, typename NestedXpr, typename Plain>
|
||||
struct blas_traits<CwiseBinaryOp<scalar_product_op<Scalar>, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain>, NestedXpr> >
|
||||
: blas_traits<NestedXpr>
|
||||
{
|
||||
enum {
|
||||
HasScalarFactor = true
|
||||
};
|
||||
typedef blas_traits<NestedXpr> Base;
|
||||
typedef CwiseBinaryOp<scalar_product_op<Scalar>, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain>, NestedXpr> XprType;
|
||||
typedef typename Base::ExtractType ExtractType;
|
||||
@@ -317,6 +321,9 @@ template<typename Scalar, typename NestedXpr, typename Plain>
|
||||
struct blas_traits<CwiseBinaryOp<scalar_product_op<Scalar>, NestedXpr, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain> > >
|
||||
: blas_traits<NestedXpr>
|
||||
{
|
||||
enum {
|
||||
HasScalarFactor = true
|
||||
};
|
||||
typedef blas_traits<NestedXpr> Base;
|
||||
typedef CwiseBinaryOp<scalar_product_op<Scalar>, NestedXpr, const CwiseNullaryOp<scalar_constant_op<Scalar>,Plain> > XprType;
|
||||
typedef typename Base::ExtractType ExtractType;
|
||||
@@ -335,6 +342,9 @@ template<typename Scalar, typename NestedXpr>
|
||||
struct blas_traits<CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> >
|
||||
: blas_traits<NestedXpr>
|
||||
{
|
||||
enum {
|
||||
HasScalarFactor = true
|
||||
};
|
||||
typedef blas_traits<NestedXpr> Base;
|
||||
typedef CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> XprType;
|
||||
typedef typename Base::ExtractType ExtractType;
|
||||
|
||||
@@ -10,13 +10,6 @@
|
||||
#ifndef EIGEN_CONFIGURE_VECTORIZATION_H
|
||||
#define EIGEN_CONFIGURE_VECTORIZATION_H
|
||||
|
||||
// FIXME: not sure why this is needed, perhaps it is not needed anymore.
|
||||
#ifdef __NVCC__
|
||||
#ifndef EIGEN_DONT_VECTORIZE
|
||||
#define EIGEN_DONT_VECTORIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Static and dynamic alignment control
|
||||
//
|
||||
@@ -36,10 +29,15 @@
|
||||
*
|
||||
* If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
|
||||
* vectorized and non-vectorized code.
|
||||
*
|
||||
* FIXME: this code can be cleaned up once we switch to proper C++11 only.
|
||||
*/
|
||||
#if (defined EIGEN_CUDACC)
|
||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n)
|
||||
#define EIGEN_ALIGNOF(x) __alignof(x)
|
||||
#elif EIGEN_HAS_ALIGNAS
|
||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) alignas(n)
|
||||
#define EIGEN_ALIGNOF(x) alignof(x)
|
||||
#elif EIGEN_COMP_GNUC || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM
|
||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
|
||||
#define EIGEN_ALIGNOF(x) __alignof(x)
|
||||
@@ -51,12 +49,18 @@
|
||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
|
||||
#define EIGEN_ALIGNOF(x) __alignof(x)
|
||||
#else
|
||||
#error Please tell me what is the equivalent of __attribute__((aligned(n))) and __alignof(x) for your compiler
|
||||
#error Please tell me what is the equivalent of alignas(n) and alignof(x) for your compiler
|
||||
#endif
|
||||
|
||||
// If the user explicitly disable vectorization, then we also disable alignment
|
||||
#if defined(EIGEN_DONT_VECTORIZE)
|
||||
#define EIGEN_IDEAL_MAX_ALIGN_BYTES 0
|
||||
#if defined(EIGEN_GPUCC)
|
||||
// GPU code is always vectorized and requires memory alignment for
|
||||
// statically allocated buffers.
|
||||
#define EIGEN_IDEAL_MAX_ALIGN_BYTES 16
|
||||
#else
|
||||
#define EIGEN_IDEAL_MAX_ALIGN_BYTES 0
|
||||
#endif
|
||||
#elif defined(__AVX512F__)
|
||||
// 64 bytes static alignment is preferred only if really required
|
||||
#define EIGEN_IDEAL_MAX_ALIGN_BYTES 64
|
||||
@@ -183,8 +187,6 @@
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// if alignment is disabled, then disable vectorization. Note: EIGEN_MAX_ALIGN_BYTES is the proper check, it takes into
|
||||
// account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks
|
||||
#if EIGEN_MAX_ALIGN_BYTES==0
|
||||
@@ -211,7 +213,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef EIGEN_DONT_VECTORIZE
|
||||
#if !(defined(EIGEN_DONT_VECTORIZE) || defined(EIGEN_GPUCC))
|
||||
|
||||
#if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
|
||||
|
||||
@@ -253,10 +255,19 @@
|
||||
#define EIGEN_VECTORIZE_SSE4_1
|
||||
#define EIGEN_VECTORIZE_SSE4_2
|
||||
#endif
|
||||
#ifdef __FMA__
|
||||
#if defined(__FMA__) || (EIGEN_COMP_MSVC && defined(__AVX2__))
|
||||
// MSVC does not expose a switch dedicated for FMA
|
||||
// For MSVC, AVX2 => FMA
|
||||
#define EIGEN_VECTORIZE_FMA
|
||||
#endif
|
||||
#if defined(__AVX512F__)
|
||||
#ifndef EIGEN_VECTORIZE_FMA
|
||||
#if EIGEN_COMP_GNUC
|
||||
#error Please add -mfma to your compiler flags: compiling with -mavx512f alone without SSE/AVX FMA is not supported (bug 1638).
|
||||
#else
|
||||
#error Please enable FMA in your compiler flags (e.g. -mfma): compiling with AVX512 alone without SSE/AVX FMA is not supported (bug 1638).
|
||||
#endif
|
||||
#endif
|
||||
#define EIGEN_VECTORIZE_AVX512
|
||||
#define EIGEN_VECTORIZE_AVX2
|
||||
#define EIGEN_VECTORIZE_AVX
|
||||
@@ -375,7 +386,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(EIGEN_HAS_CUDA_FP16)
|
||||
#include <host_defines.h>
|
||||
#include <cuda_runtime_api.h>
|
||||
#include <cuda_fp16.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -47,11 +47,7 @@ template<typename T> struct NumTraits;
|
||||
template<typename Derived> struct EigenBase;
|
||||
template<typename Derived> class DenseBase;
|
||||
template<typename Derived> class PlainObjectBase;
|
||||
|
||||
|
||||
template<typename Derived,
|
||||
int Level = internal::accessors_level<Derived>::value >
|
||||
class DenseCoeffsBase;
|
||||
template<typename Derived, int Level> class DenseCoeffsBase;
|
||||
|
||||
template<typename _Scalar, int _Rows, int _Cols,
|
||||
int _Options = AutoAlign |
|
||||
@@ -260,6 +256,7 @@ template<typename MatrixType> class HouseholderQR;
|
||||
template<typename MatrixType> class ColPivHouseholderQR;
|
||||
template<typename MatrixType> class FullPivHouseholderQR;
|
||||
template<typename MatrixType> class CompleteOrthogonalDecomposition;
|
||||
template<typename MatrixType> class SVDBase;
|
||||
template<typename MatrixType, int QRPreconditioner = ColPivHouseholderQRPreconditioner> class JacobiSVD;
|
||||
template<typename MatrixType> class BDCSVD;
|
||||
template<typename MatrixType, int UpLo = Lower> class LLT;
|
||||
|
||||
@@ -23,7 +23,7 @@ struct symbolic_last_tag {};
|
||||
* Can be used as a parameter to Eigen::seq and Eigen::seqN functions to symbolically reference the last element/row/columns
|
||||
* of the underlying vector or matrix once passed to DenseBase::operator()(const RowIndices&, const ColIndices&).
|
||||
*
|
||||
* This symbolic placeholder support standard arithmetic operation.
|
||||
* This symbolic placeholder supports standard arithmetic operations.
|
||||
*
|
||||
* A typical usage example would be:
|
||||
* \code
|
||||
@@ -44,7 +44,7 @@ static const symbolic::SymbolExpr<internal::symbolic_last_tag> last; // PLEASE u
|
||||
* reference the last+1 element/row/columns of the underlying vector or matrix once
|
||||
* passed to DenseBase::operator()(const RowIndices&, const ColIndices&).
|
||||
*
|
||||
* This symbolic placeholder support standard arithmetic operation.
|
||||
* This symbolic placeholder supports standard arithmetic operations.
|
||||
* It is essentially an alias to last+fix<1>.
|
||||
*
|
||||
* \sa last
|
||||
|
||||
@@ -129,16 +129,21 @@
|
||||
#define EIGEN_COMP_MSVC_STRICT 0
|
||||
#endif
|
||||
|
||||
/// \internal EIGEN_COMP_IBM set to 1 if the compiler is IBM XL C++
|
||||
#if defined(__IBMCPP__) || defined(__xlc__)
|
||||
#define EIGEN_COMP_IBM 1
|
||||
/// \internal EIGEN_COMP_IBM set to xlc version if the compiler is IBM XL C++
|
||||
// XLC version
|
||||
// 3.1 0x0301
|
||||
// 4.5 0x0405
|
||||
// 5.0 0x0500
|
||||
// 12.1 0x0C01
|
||||
#if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
|
||||
#define EIGEN_COMP_IBM __xlC__
|
||||
#else
|
||||
#define EIGEN_COMP_IBM 0
|
||||
#endif
|
||||
|
||||
/// \internal EIGEN_COMP_PGI set to 1 if the compiler is Portland Group Compiler
|
||||
/// \internal EIGEN_COMP_PGI set to PGI version if the compiler is Portland Group Compiler
|
||||
#if defined(__PGI)
|
||||
#define EIGEN_COMP_PGI 1
|
||||
#define EIGEN_COMP_PGI (__PGIC__*100+__PGIC_MINOR__)
|
||||
#else
|
||||
#define EIGEN_COMP_PGI 0
|
||||
#endif
|
||||
@@ -347,9 +352,17 @@
|
||||
#define EIGEN_OS_WIN_STRICT 0
|
||||
#endif
|
||||
|
||||
/// \internal EIGEN_OS_SUN set to 1 if the OS is SUN
|
||||
/// \internal EIGEN_OS_SUN set to __SUNPRO_C if the OS is SUN
|
||||
// compiler solaris __SUNPRO_C
|
||||
// version studio
|
||||
// 5.7 10 0x570
|
||||
// 5.8 11 0x580
|
||||
// 5.9 12 0x590
|
||||
// 5.10 12.1 0x5100
|
||||
// 5.11 12.2 0x5110
|
||||
// 5.12 12.3 0x5120
|
||||
#if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__))
|
||||
#define EIGEN_OS_SUN 1
|
||||
#define EIGEN_OS_SUN __SUNPRO_C
|
||||
#else
|
||||
#define EIGEN_OS_SUN 0
|
||||
#endif
|
||||
@@ -495,13 +508,33 @@
|
||||
#define EIGEN_HAS_STATIC_ARRAY_TEMPLATE 0
|
||||
#endif
|
||||
|
||||
#if EIGEN_MAX_CPP_VER>=11 && (defined(__cplusplus) && (__cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900)
|
||||
|
||||
// The macro EIGEN_COMP_CXXVER defines the c++ verson expected by the compiler.
|
||||
// For instance, if compiling with gcc and -std=c++17, then EIGEN_COMP_CXXVER
|
||||
// is defined to 17.
|
||||
#if (defined(__cplusplus) && (__cplusplus > 201402L) || EIGEN_COMP_MSVC >= 1914)
|
||||
#define EIGEN_COMP_CXXVER 17
|
||||
#elif (defined(__cplusplus) && (__cplusplus > 201103L) || EIGEN_COMP_MSVC >= 1910)
|
||||
#define EIGEN_COMP_CXXVER 14
|
||||
#elif (defined(__cplusplus) && (__cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900)
|
||||
#define EIGEN_COMP_CXXVER 11
|
||||
#else
|
||||
#define EIGEN_COMP_CXXVER 03
|
||||
#endif
|
||||
|
||||
|
||||
// The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
|
||||
// but in practice we should not rely on them but rather on the availabilty of
|
||||
// individual features as defined later.
|
||||
// This is why there is no EIGEN_HAS_CXX17.
|
||||
// FIXME: get rid of EIGEN_HAS_CXX14 and maybe even EIGEN_HAS_CXX11.
|
||||
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_COMP_CXXVER>=11
|
||||
#define EIGEN_HAS_CXX11 1
|
||||
#else
|
||||
#define EIGEN_HAS_CXX11 0
|
||||
#endif
|
||||
|
||||
#if EIGEN_MAX_CPP_VER>=14 && (defined(__cplusplus) && (__cplusplus > 201103L) || EIGEN_COMP_MSVC >= 1910)
|
||||
#if EIGEN_MAX_CPP_VER>=14 && EIGEN_COMP_CXXVER>=14
|
||||
#define EIGEN_HAS_CXX14 1
|
||||
#else
|
||||
#define EIGEN_HAS_CXX14 0
|
||||
@@ -546,6 +579,22 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EIGEN_HAS_ALIGNAS
|
||||
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \
|
||||
( __has_feature(cxx_alignas) \
|
||||
|| EIGEN_HAS_CXX14 \
|
||||
|| (EIGEN_COMP_MSVC >= 1800) \
|
||||
|| (EIGEN_GNUC_AT_LEAST(4,8)) \
|
||||
|| (EIGEN_COMP_CLANG>=305) \
|
||||
|| (EIGEN_COMP_ICC>=1500) \
|
||||
|| (EIGEN_COMP_PGI>=1500) \
|
||||
|| (EIGEN_COMP_SUNCC>=0x5130))
|
||||
#define EIGEN_HAS_ALIGNAS 1
|
||||
#else
|
||||
#define EIGEN_HAS_ALIGNAS 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Does the compiler support type_traits?
|
||||
// - full support of type traits was added only to GCC 5.1.0.
|
||||
// - 20150626 corresponds to the last release of 4.x libstdc++
|
||||
@@ -649,6 +698,23 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// NOTE: the required Apple's clang version is very conservative
|
||||
// and it could be that XCode 9 works just fine.
|
||||
// NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support
|
||||
// and not tested.
|
||||
#ifndef EIGEN_HAS_CXX17_OVERALIGN
|
||||
#if EIGEN_MAX_CPP_VER>=17 && EIGEN_COMP_CXXVER>=17 && ( \
|
||||
(EIGEN_COMP_MSVC >= 1912) \
|
||||
|| (EIGEN_GNUC_AT_LEAST(7,0)) \
|
||||
|| ((!defined(__apple_build_version__)) && (EIGEN_COMP_CLANG>=500)) \
|
||||
|| (( defined(__apple_build_version__)) && (__apple_build_version__>=10000000)) \
|
||||
)
|
||||
#define EIGEN_HAS_CXX17_OVERALIGN 1
|
||||
#else
|
||||
#define EIGEN_HAS_CXX17_OVERALIGN 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(EIGEN_CUDACC) && EIGEN_HAS_CONSTEXPR
|
||||
// While available already with c++11, this is useful mostly starting with c++14 and relaxed constexpr rules
|
||||
#if defined(__NVCC__)
|
||||
@@ -742,10 +808,6 @@
|
||||
|
||||
// All functions callable from CUDA/HIP code must be qualified with __device__
|
||||
#ifdef EIGEN_GPUCC
|
||||
#ifndef EIGEN_DONT_VECTORIZE
|
||||
#define EIGEN_DONT_VECTORIZE
|
||||
#endif
|
||||
|
||||
#define EIGEN_DEVICE_FUNC __host__ __device__
|
||||
#else
|
||||
#define EIGEN_DEVICE_FUNC
|
||||
@@ -841,7 +903,7 @@
|
||||
// Suppresses 'unused variable' warnings.
|
||||
namespace Eigen {
|
||||
namespace internal {
|
||||
template<typename T> EIGEN_DEVICE_FUNC void ignore_unused_variable(const T&) {}
|
||||
template<typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void ignore_unused_variable(const T&) {}
|
||||
}
|
||||
}
|
||||
#define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var);
|
||||
@@ -1035,7 +1097,7 @@ namespace Eigen {
|
||||
#endif
|
||||
|
||||
#define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \
|
||||
template <typename T> EIGEN_DEVICE_FUNC inline \
|
||||
template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
|
||||
EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type,OPNAME))\
|
||||
(METHOD)(const T& scalar) const { \
|
||||
typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \
|
||||
@@ -1044,7 +1106,7 @@ namespace Eigen {
|
||||
}
|
||||
|
||||
#define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
|
||||
template <typename T> EIGEN_DEVICE_FUNC inline friend \
|
||||
template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend \
|
||||
EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type,Derived,OPNAME)) \
|
||||
(METHOD)(const T& scalar, const StorageBaseType& matrix) { \
|
||||
typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \
|
||||
@@ -1093,9 +1155,9 @@ namespace Eigen {
|
||||
# define EIGEN_NOEXCEPT
|
||||
# define EIGEN_NOEXCEPT_IF(x)
|
||||
# define EIGEN_NO_THROW throw()
|
||||
# if EIGEN_COMP_MSVC
|
||||
# if EIGEN_COMP_MSVC || EIGEN_COMP_CXXVER>=17
|
||||
// MSVC does not support exception specifications (warning C4290),
|
||||
// and they are deprecated in c++11 anyway.
|
||||
// and they are deprecated in c++11 anyway. This is even an error in c++17.
|
||||
# define EIGEN_EXCEPTION_SPEC(X) throw()
|
||||
# else
|
||||
# define EIGEN_EXCEPTION_SPEC(X) throw(X)
|
||||
|
||||
@@ -360,7 +360,7 @@ template<typename T, bool Align> EIGEN_DEVICE_FUNC inline T* conditional_aligned
|
||||
template<typename T> EIGEN_DEVICE_FUNC inline void aligned_delete(T *ptr, std::size_t size)
|
||||
{
|
||||
destruct_elements_of_array<T>(ptr, size);
|
||||
aligned_free(ptr);
|
||||
Eigen::internal::aligned_free(ptr);
|
||||
}
|
||||
|
||||
/** \internal Deletes objects constructed with conditional_aligned_new
|
||||
@@ -768,6 +768,17 @@ template<typename T> void swap(scoped_array<T> &a,scoped_array<T> &b)
|
||||
*** Implementation of EIGEN_MAKE_ALIGNED_OPERATOR_NEW [_IF] ***
|
||||
*****************************************************************************/
|
||||
|
||||
#if EIGEN_HAS_CXX17_OVERALIGN
|
||||
|
||||
// C++17 -> no need to bother about alignment anymore :)
|
||||
|
||||
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW(NeedsToAlign)
|
||||
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
|
||||
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
|
||||
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar,Size)
|
||||
|
||||
#else
|
||||
|
||||
#if EIGEN_MAX_ALIGN_BYTES!=0
|
||||
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW(NeedsToAlign) \
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) EIGEN_NO_THROW { \
|
||||
@@ -810,6 +821,8 @@ template<typename T> void swap(scoped_array<T> &a,scoped_array<T> &b)
|
||||
((EIGEN_MAX_ALIGN_BYTES>=32) && ((sizeof(Scalar)*(Size))%(EIGEN_MAX_ALIGN_BYTES/2)==0)) || \
|
||||
((EIGEN_MAX_ALIGN_BYTES>=64) && ((sizeof(Scalar)*(Size))%(EIGEN_MAX_ALIGN_BYTES/4)==0)) )))
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/** \class aligned_allocator
|
||||
|
||||
@@ -636,8 +636,41 @@ template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||
bool not_equal_strict(const double& x,const double& y) { return std::not_equal_to<double>()(x,y); }
|
||||
#endif
|
||||
|
||||
/** \internal extract the bits of the float \a x */
|
||||
inline unsigned int as_uint(float x)
|
||||
{
|
||||
unsigned int ret;
|
||||
std::memcpy(&ret, &x, sizeof(float));
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // end namespace numext
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
// Define portable (u)int{32,64} types
|
||||
#if EIGEN_HAS_CXX11
|
||||
#include <cstdint>
|
||||
namespace Eigen {
|
||||
namespace numext {
|
||||
typedef std::uint32_t uint32_t;
|
||||
typedef std::int32_t int32_t;
|
||||
typedef std::uint64_t uint64_t;
|
||||
typedef std::int64_t int64_t;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Without c++11, all compilers able to compile Eigen also
|
||||
// provides the C99 stdint.h header file.
|
||||
#include <stdint.h>
|
||||
namespace Eigen {
|
||||
namespace numext {
|
||||
typedef ::uint32_t uint32_t;
|
||||
typedef ::int32_t int32_t;
|
||||
typedef ::uint64_t uint64_t;
|
||||
typedef ::int64_t int64_t;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // EIGEN_META_H
|
||||
|
||||
@@ -104,7 +104,8 @@
|
||||
STORAGE_INDEX_MUST_MATCH=1,
|
||||
CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY=1,
|
||||
SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY=1,
|
||||
INVALID_TEMPLATE_PARAMETER=1
|
||||
INVALID_TEMPLATE_PARAMETER=1,
|
||||
GPU_TENSOR_CONTRACTION_DOES_NOT_SUPPORT_OUTPUT_KERNELS=1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -184,7 +184,8 @@ template<typename T> struct unpacket_traits
|
||||
enum
|
||||
{
|
||||
size = 1,
|
||||
alignment = 1
|
||||
alignment = 1,
|
||||
vectorizable = false
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user