mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Set of fixes and workaround to make sun studio more happy.
Still remains the problem of alignment and vectorization.
This commit is contained in:
@@ -188,7 +188,7 @@ const unsigned int HereditaryBits = RowMajorBit
|
||||
|
||||
// diagonal means both upper and lower triangular
|
||||
const unsigned DiagonalBits = UpperTriangularBit | LowerTriangularBit;
|
||||
|
||||
|
||||
// Possible values for the Mode parameter of part()
|
||||
const unsigned int UpperTriangular = UpperTriangularBit;
|
||||
const unsigned int StrictlyUpperTriangular = UpperTriangularBit | ZeroDiagBit;
|
||||
@@ -201,7 +201,7 @@ const unsigned int UnitLowerTriangular = LowerTriangularBit | UnitDiagBit;
|
||||
template<typename T> struct ei_is_diagonal
|
||||
{
|
||||
enum {
|
||||
ret = ( (unsigned int)(T::Flags) & DiagonalBits ) == DiagonalBits
|
||||
ret = ( int(ei_traits<T>::Flags) & DiagonalBits ) == DiagonalBits
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ template<typename Scalar1,typename Scalar2> struct ei_scalar_multiple2_op;
|
||||
struct IOFormat;
|
||||
|
||||
template<typename Scalar>
|
||||
void ei_cache_friendly_product(
|
||||
static void ei_cache_friendly_product(
|
||||
int _rows, int _cols, int depth,
|
||||
bool _lhsRowMajor, const Scalar* _lhs, int _lhsStride,
|
||||
bool _rhsRowMajor, const Scalar* _rhs, int _rhsStride,
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
#define EIGEN_GCC3_OR_OLDER 0
|
||||
#endif
|
||||
|
||||
#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT && !EIGEN_GCC3_OR_OLDER
|
||||
// FIXME vectorization + alignment is completely disabled with sun studio
|
||||
#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT && !EIGEN_GCC3_OR_OLDER && !defined(__SUNPRO_CC)
|
||||
#define EIGEN_ARCH_WANTS_ALIGNMENT 1
|
||||
#else
|
||||
#define EIGEN_ARCH_WANTS_ALIGNMENT 0
|
||||
@@ -97,7 +98,7 @@
|
||||
/** Allows to disable some optimizations which might affect the accuracy of the result.
|
||||
* Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
|
||||
* They currently include:
|
||||
* - single precision Cwise::sin() and Cwise::cos() when SSE vectorization is enabled.
|
||||
* - single precision Cwise::sin() and Cwise::cos() when SSE vectorization is enabled.
|
||||
*/
|
||||
#ifndef EIGEN_FAST_MATH
|
||||
#define EIGEN_FAST_MATH 1
|
||||
@@ -199,13 +200,16 @@ using Eigen::ei_cos;
|
||||
* vectorized and non-vectorized code.
|
||||
*/
|
||||
#if !EIGEN_ALIGN
|
||||
#define EIGEN_ALIGN_128
|
||||
#define EIGEN_ALIGN_128
|
||||
#elif (defined __GNUC__)
|
||||
#define EIGEN_ALIGN_128 __attribute__((aligned(16)))
|
||||
#define EIGEN_ALIGN_128 __attribute__((aligned(16)))
|
||||
#elif (defined _MSC_VER)
|
||||
#define EIGEN_ALIGN_128 __declspec(align(16))
|
||||
#define EIGEN_ALIGN_128 __declspec(align(16))
|
||||
#elif (defined __SUNPRO_CC)
|
||||
// FIXME not sure about this one:
|
||||
#define EIGEN_ALIGN_128 __attribute__((aligned(16)))
|
||||
#else
|
||||
#error Please tell me what is the equivalent of __attribute__((aligned(16))) for your compiler
|
||||
#error Please tell me what is the equivalent of __attribute__((aligned(16))) for your compiler
|
||||
#endif
|
||||
|
||||
#define EIGEN_RESTRICT __restrict
|
||||
|
||||
Reference in New Issue
Block a user