This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 973 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Core/CoreEvaluators.h (-3 / +13 lines)
Lines 642-662 struct evaluator<Map<PlainObjectType, Ma Link Here
642
    OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
642
    OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
643
                             ? int(PlainObjectType::OuterStrideAtCompileTime)
643
                             ? int(PlainObjectType::OuterStrideAtCompileTime)
644
                             : int(StrideType::OuterStrideAtCompileTime),
644
                             : int(StrideType::OuterStrideAtCompileTime),
645
    HasNoInnerStride = InnerStrideAtCompileTime == 1,
645
    HasNoInnerStride = InnerStrideAtCompileTime == 1,
646
    HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
646
    HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
647
    HasNoStride = HasNoInnerStride && HasNoOuterStride,
647
    HasNoStride = HasNoInnerStride && HasNoOuterStride,
648
    IsAligned = bool(EIGEN_ALIGN) && ((int(MapOptions)&Aligned)==Aligned),
648
    IsAligned = bool(EIGEN_ALIGN) && ((int(MapOptions)&Aligned)==Aligned),
649
    IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
649
    IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
650
    
651
    // TODO: should check for smaller packet types once we can handle multi-sized packet types
652
    AlignBytes = int(packet_traits<Scalar>::size) * sizeof(Scalar),
653
    
650
    KeepsPacketAccess = bool(HasNoInnerStride)
654
    KeepsPacketAccess = bool(HasNoInnerStride)
651
                        && ( bool(IsDynamicSize)
655
                        && ( bool(IsDynamicSize)
652
                           || HasNoOuterStride
656
                           || HasNoOuterStride
653
                           || ( OuterStrideAtCompileTime!=Dynamic
657
                           || ( OuterStrideAtCompileTime!=Dynamic
654
                           && ((static_cast<int>(sizeof(Scalar))*OuterStrideAtCompileTime)%EIGEN_ALIGN_BYTES)==0 ) ),
658
                           && ((static_cast<int>(sizeof(Scalar))*OuterStrideAtCompileTime) % AlignBytes)==0 ) ),
655
    Flags0 = evaluator<PlainObjectType>::Flags,
659
    Flags0 = evaluator<PlainObjectType>::Flags,
656
    Flags1 = IsAligned ? (int(Flags0) | AlignedBit) : (int(Flags0) & ~AlignedBit),
660
    Flags1 = IsAligned ? (int(Flags0) | AlignedBit) : (int(Flags0) & ~AlignedBit),
657
    Flags2 = (bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime))
661
    Flags2 = (bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime))
658
           ? int(Flags1) : int(Flags1 & ~LinearAccessBit),
662
           ? int(Flags1) : int(Flags1 & ~LinearAccessBit),
659
    Flags = KeepsPacketAccess ? int(Flags2) : (int(Flags2) & ~PacketAccessBit)
663
    Flags = KeepsPacketAccess ? int(Flags2) : (int(Flags2) & ~PacketAccessBit)
660
  };
664
  };
661
665
662
  EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map)
666
  EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map)
Lines 712-728 struct evaluator<Block<ArgType, BlockRow Link Here
712
                             : int(outer_stride_at_compile_time<ArgType>::ret),
716
                             : int(outer_stride_at_compile_time<ArgType>::ret),
713
    OuterStrideAtCompileTime = HasSameStorageOrderAsArgType
717
    OuterStrideAtCompileTime = HasSameStorageOrderAsArgType
714
                             ? int(outer_stride_at_compile_time<ArgType>::ret)
718
                             ? int(outer_stride_at_compile_time<ArgType>::ret)
715
                             : int(inner_stride_at_compile_time<ArgType>::ret),
719
                             : int(inner_stride_at_compile_time<ArgType>::ret),
716
    MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits<Scalar>::size) == 0)
720
    MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits<Scalar>::size) == 0)
717
                       && (InnerStrideAtCompileTime == 1)
721
                       && (InnerStrideAtCompileTime == 1)
718
                        ? PacketAccessBit : 0,
722
                        ? PacketAccessBit : 0,
719
    
723
    
720
    MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % EIGEN_ALIGN_BYTES) == 0)) ? AlignedBit : 0,
724
    // TODO: should check for smaller packet types once we can handle multi-sized packet types
725
    AlignBytes = int(packet_traits<Scalar>::size) * sizeof(Scalar),
726
    
727
    MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % AlignBytes) == 0)) ? AlignedBit : 0,
721
    FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,    
728
    FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,    
722
    FlagsRowMajorBit = XprType::Flags&RowMajorBit,
729
    FlagsRowMajorBit = XprType::Flags&RowMajorBit,
723
    Flags0 = evaluator<ArgType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
730
    Flags0 = evaluator<ArgType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
724
                                           DirectAccessBit |
731
                                           DirectAccessBit |
725
                                           MaskPacketAccessBit |
732
                                           MaskPacketAccessBit |
726
                                           MaskAlignedBit),
733
                                           MaskAlignedBit),
727
    Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit
734
    Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit
728
  };
735
  };
Lines 820-841 protected: Link Here
820
// all action is via the data() as returned by the Block expression.
827
// all action is via the data() as returned by the Block expression.
821
828
822
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel> 
829
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel> 
823
struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAccess */ true>
830
struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAccess */ true>
824
  : mapbase_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>,
831
  : mapbase_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>,
825
                      typename Block<ArgType, BlockRows, BlockCols, InnerPanel>::PlainObject>
832
                      typename Block<ArgType, BlockRows, BlockCols, InnerPanel>::PlainObject>
826
{
833
{
827
  typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
834
  typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
835
  typedef typename XprType::Scalar Scalar;
828
836
829
  EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block)
837
  EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block)
830
    : mapbase_evaluator<XprType, typename XprType::PlainObject>(block) 
838
    : mapbase_evaluator<XprType, typename XprType::PlainObject>(block) 
831
  {
839
  {
840
    // TODO: should check for smaller packet types once we can handle multi-sized packet types
841
    const int AlignBytes = int(packet_traits<Scalar>::size) * sizeof(Scalar);
832
    // FIXME this should be an internal assertion
842
    // FIXME this should be an internal assertion
833
    eigen_assert(EIGEN_IMPLIES(evaluator<XprType>::Flags&AlignedBit, (size_t(block.data()) % EIGEN_ALIGN_BYTES) == 0) && "data is not aligned");
843
    eigen_assert(EIGEN_IMPLIES(evaluator<XprType>::Flags&AlignedBit, (size_t(block.data()) % AlignBytes) == 0) && "data is not aligned");
834
  }
844
  }
835
};
845
};
836
846
837
847
838
// -------------------- Select --------------------
848
// -------------------- Select --------------------
839
// TODO shall we introduce a ternary_evaluator?
849
// TODO shall we introduce a ternary_evaluator?
840
850
841
// TODO enable vectorization for Select
851
// TODO enable vectorization for Select
(-)a/Eigen/src/Core/DenseStorage.h (-5 / +84 lines)
Lines 29-52 EIGEN_DEVICE_FUNC Link Here
29
void check_static_allocation_size()
29
void check_static_allocation_size()
30
{
30
{
31
  // if EIGEN_STACK_ALLOCATION_LIMIT is defined to 0, then no limit
31
  // if EIGEN_STACK_ALLOCATION_LIMIT is defined to 0, then no limit
32
  #if EIGEN_STACK_ALLOCATION_LIMIT
32
  #if EIGEN_STACK_ALLOCATION_LIMIT
33
  EIGEN_STATIC_ASSERT(Size * sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
33
  EIGEN_STATIC_ASSERT(Size * sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
34
  #endif
34
  #endif
35
}
35
}
36
36
37
template<typename T, int Size, typename Packet = typename packet_traits<T>::type,
38
         bool Match     = bool((Size%unpacket_traits<Packet>::size)==0),
39
         bool TryHalf   =  bool(unpacket_traits<Packet>::size > Size)
40
                        && bool(unpacket_traits<Packet>::size > unpacket_traits<typename unpacket_traits<Packet>::half>::size) >
41
struct compute_default_alignment
42
{
43
  enum { value = 0 };
44
};
45
46
template<typename T, int Size, typename Packet>
47
struct compute_default_alignment<T, Size, Packet, true, false> // Match
48
{
49
  enum { value = sizeof(T) * unpacket_traits<Packet>::size };
50
};
51
52
template<typename T, int Size, typename Packet>
53
struct compute_default_alignment<T, Size, Packet, false, true>
54
{
55
  // current packet too large, try with an half-packet
56
  enum { value = compute_default_alignment<T, Size, typename unpacket_traits<Packet>::half>::value };
57
};
58
37
/** \internal
59
/** \internal
38
  * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned:
60
  * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned:
39
  * to 16 bytes boundary if the total size is a multiple of 16 bytes.
61
  * to 16 bytes boundary if the total size is a multiple of 16 bytes.
40
  */
62
  */
41
template <typename T, int Size, int MatrixOrArrayOptions,
63
template <typename T, int Size, int MatrixOrArrayOptions,
42
          int Alignment = (MatrixOrArrayOptions&DontAlign) ? 0
64
          int Alignment = (MatrixOrArrayOptions&DontAlign) ? 0
43
                        : (((Size*sizeof(T))%EIGEN_ALIGN_BYTES)==0) ? EIGEN_ALIGN_BYTES
65
                        : compute_default_alignment<T,Size>::value >
44
                        : 0 >
66
//                         : (((Size*sizeof(T))%EIGEN_ALIGN_BYTES)==0) ? EIGEN_ALIGN_BYTES : 0 >
45
struct plain_array
67
struct plain_array
46
{
68
{
47
  T array[Size];
69
  T array[Size];
48
70
49
  EIGEN_DEVICE_FUNC
71
  EIGEN_DEVICE_FUNC
50
  plain_array()
72
  plain_array()
51
  { 
73
  { 
52
    check_static_allocation_size<T,Size>();
74
    check_static_allocation_size<T,Size>();
Lines 76-99 struct plain_array Link Here
76
  #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
98
  #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
77
    eigen_assert((reinterpret_cast<size_t>(array) & (sizemask)) == 0 \
99
    eigen_assert((reinterpret_cast<size_t>(array) & (sizemask)) == 0 \
78
              && "this assertion is explained here: " \
100
              && "this assertion is explained here: " \
79
              "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \
101
              "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \
80
              " **** READ THIS WEB PAGE !!! ****");
102
              " **** READ THIS WEB PAGE !!! ****");
81
#endif
103
#endif
82
104
83
template <typename T, int Size, int MatrixOrArrayOptions>
105
template <typename T, int Size, int MatrixOrArrayOptions>
84
struct plain_array<T, Size, MatrixOrArrayOptions, EIGEN_ALIGN_BYTES>
106
struct plain_array<T, Size, MatrixOrArrayOptions, 8>
85
{
107
{
86
  EIGEN_USER_ALIGN_DEFAULT T array[Size];
108
  EIGEN_ALIGN_TO_BOUNDARY(8) T array[Size];
87
109
88
  EIGEN_DEVICE_FUNC
110
  EIGEN_DEVICE_FUNC
89
  plain_array() 
111
  plain_array() 
90
  { 
112
  { 
91
    EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(EIGEN_ALIGN_BYTES-1);
113
    EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(7);
114
    check_static_allocation_size<T,Size>();
115
  }
116
117
  EIGEN_DEVICE_FUNC
118
  plain_array(constructor_without_unaligned_array_assert) 
119
  { 
120
    check_static_allocation_size<T,Size>();
121
  }
122
};
123
124
template <typename T, int Size, int MatrixOrArrayOptions>
125
struct plain_array<T, Size, MatrixOrArrayOptions, 16>
126
{
127
  EIGEN_ALIGN_TO_BOUNDARY(16) T array[Size];
128
129
  EIGEN_DEVICE_FUNC
130
  plain_array() 
131
  { 
132
    EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(15);
133
    check_static_allocation_size<T,Size>();
134
  }
135
136
  EIGEN_DEVICE_FUNC
137
  plain_array(constructor_without_unaligned_array_assert) 
138
  { 
139
    check_static_allocation_size<T,Size>();
140
  }
141
};
142
143
template <typename T, int Size, int MatrixOrArrayOptions>
144
struct plain_array<T, Size, MatrixOrArrayOptions, 32>
145
{
146
  EIGEN_ALIGN_TO_BOUNDARY(32) T array[Size];
147
148
  EIGEN_DEVICE_FUNC
149
  plain_array() 
150
  { 
151
    EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(31);
152
    check_static_allocation_size<T,Size>();
153
  }
154
155
  EIGEN_DEVICE_FUNC
156
  plain_array(constructor_without_unaligned_array_assert) 
157
  { 
158
    check_static_allocation_size<T,Size>();
159
  }
160
};
161
162
template <typename T, int Size, int MatrixOrArrayOptions>
163
struct plain_array<T, Size, MatrixOrArrayOptions, 64>
164
{
165
  EIGEN_ALIGN_TO_BOUNDARY(64) T array[Size];
166
167
  EIGEN_DEVICE_FUNC
168
  plain_array() 
169
  { 
170
    EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(63);
92
    check_static_allocation_size<T,Size>();
171
    check_static_allocation_size<T,Size>();
93
  }
172
  }
94
173
95
  EIGEN_DEVICE_FUNC
174
  EIGEN_DEVICE_FUNC
96
  plain_array(constructor_without_unaligned_array_assert) 
175
  plain_array(constructor_without_unaligned_array_assert) 
97
  { 
176
  { 
98
    check_static_allocation_size<T,Size>();
177
    check_static_allocation_size<T,Size>();
99
  }
178
  }
(-)a/Eigen/src/Core/util/Macros.h (+3 lines)
Lines 313-328 Link Here
313
  #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1
313
  #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1
314
#else
314
#else
315
  #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0
315
  #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0
316
#endif
316
#endif
317
317
318
// Defined the boundary (in bytes) on which the data needs to be aligned. Note
318
// Defined the boundary (in bytes) on which the data needs to be aligned. Note
319
// that unless EIGEN_ALIGN is defined and not equal to 0, the data may not be
319
// that unless EIGEN_ALIGN is defined and not equal to 0, the data may not be
320
// aligned at all regardless of the value of this #define.
320
// aligned at all regardless of the value of this #define.
321
// TODO should be renamed EIGEN_MAXIMAL_ALIGN_BYTES,
322
//      for instance with AVX 1 EIGEN_MAXIMAL_ALIGN_BYTES=32 while for 'int' 16 bytes alignment is always enough,
323
//      and 16 bytes alignment is also enough for Vector4f.
321
#define EIGEN_ALIGN_BYTES 16
324
#define EIGEN_ALIGN_BYTES 16
322
325
323
#ifdef EIGEN_DONT_ALIGN
326
#ifdef EIGEN_DONT_ALIGN
324
  #ifndef EIGEN_DONT_ALIGN_STATICALLY
327
  #ifndef EIGEN_DONT_ALIGN_STATICALLY
325
    #define EIGEN_DONT_ALIGN_STATICALLY
328
    #define EIGEN_DONT_ALIGN_STATICALLY
326
  #endif
329
  #endif
327
  #define EIGEN_ALIGN 0
330
  #define EIGEN_ALIGN 0
328
#elif !defined(EIGEN_DONT_VECTORIZE)
331
#elif !defined(EIGEN_DONT_VECTORIZE)
(-)a/Eigen/src/Core/util/XprHelper.h (-1 / +4 lines)
Lines 154-176 class compute_matrix_flags Link Here
154
};
154
};
155
155
156
template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
156
template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
157
class compute_matrix_evaluator_flags
157
class compute_matrix_evaluator_flags
158
{
158
{
159
    enum {
159
    enum {
160
      row_major_bit = Options&RowMajor ? RowMajorBit : 0,
160
      row_major_bit = Options&RowMajor ? RowMajorBit : 0,
161
      is_dynamic_size_storage = MaxRows==Dynamic || MaxCols==Dynamic,
161
      is_dynamic_size_storage = MaxRows==Dynamic || MaxCols==Dynamic,
162
      
163
      // TODO: should check for smaller packet types once we can handle multi-sized packet types
164
      align_bytes = int(packet_traits<Scalar>::size) * sizeof(Scalar),
162
165
163
      aligned_bit =
166
      aligned_bit =
164
      (
167
      (
165
            ((Options&DontAlign)==0)
168
            ((Options&DontAlign)==0)
166
        && (
169
        && (
167
#if EIGEN_ALIGN_STATICALLY
170
#if EIGEN_ALIGN_STATICALLY
168
             ((!is_dynamic_size_storage) && (((MaxCols*MaxRows*int(sizeof(Scalar))) % EIGEN_ALIGN_BYTES) == 0))
171
             ((!is_dynamic_size_storage) && (((MaxCols*MaxRows*int(sizeof(Scalar))) % align_bytes) == 0))
169
#else
172
#else
170
             0
173
             0
171
#endif
174
#endif
172
175
173
          ||
176
          ||
174
177
175
#if EIGEN_ALIGN
178
#if EIGEN_ALIGN
176
             is_dynamic_size_storage
179
             is_dynamic_size_storage
(-)a/test/unalignedassert.cpp (-3 / +4 lines)
Lines 76-92 void construct_at_boundary(int boundary) Link Here
76
  T *x = ::new(reinterpret_cast<void*>(_buf)) T;
76
  T *x = ::new(reinterpret_cast<void*>(_buf)) T;
77
  x[0].setZero(); // just in order to silence warnings
77
  x[0].setZero(); // just in order to silence warnings
78
  x->~T();
78
  x->~T();
79
}
79
}
80
#endif
80
#endif
81
81
82
void unalignedassert()
82
void unalignedassert()
83
{
83
{
84
  #if EIGEN_ALIGN_STATICALLY
84
#if EIGEN_ALIGN_STATICALLY
85
  construct_at_boundary<Vector2f>(4);
85
  construct_at_boundary<Vector2f>(4);
86
  construct_at_boundary<Vector3f>(4);
86
  construct_at_boundary<Vector3f>(4);
87
  construct_at_boundary<Vector4f>(16);
87
  construct_at_boundary<Vector4f>(16);
88
  construct_at_boundary<Matrix2f>(16);
88
  construct_at_boundary<Matrix2f>(16);
89
  construct_at_boundary<Matrix3f>(4);
89
  construct_at_boundary<Matrix3f>(4);
90
  construct_at_boundary<Matrix4f>(EIGEN_ALIGN_BYTES);
90
  construct_at_boundary<Matrix4f>(EIGEN_ALIGN_BYTES);
91
91
92
  construct_at_boundary<Vector2d>(16);
92
  construct_at_boundary<Vector2d>(16);
Lines 95-127 void unalignedassert() Link Here
95
  construct_at_boundary<Matrix2d>(EIGEN_ALIGN_BYTES);
95
  construct_at_boundary<Matrix2d>(EIGEN_ALIGN_BYTES);
96
  construct_at_boundary<Matrix3d>(4);
96
  construct_at_boundary<Matrix3d>(4);
97
  construct_at_boundary<Matrix4d>(EIGEN_ALIGN_BYTES);
97
  construct_at_boundary<Matrix4d>(EIGEN_ALIGN_BYTES);
98
98
99
  construct_at_boundary<Vector2cf>(16);
99
  construct_at_boundary<Vector2cf>(16);
100
  construct_at_boundary<Vector3cf>(4);
100
  construct_at_boundary<Vector3cf>(4);
101
  construct_at_boundary<Vector2cd>(EIGEN_ALIGN_BYTES);
101
  construct_at_boundary<Vector2cd>(EIGEN_ALIGN_BYTES);
102
  construct_at_boundary<Vector3cd>(16);
102
  construct_at_boundary<Vector3cd>(16);
103
  #endif
103
#endif
104
104
105
  check_unalignedassert_good<TestNew1>();
105
  check_unalignedassert_good<TestNew1>();
106
  check_unalignedassert_good<TestNew2>();
106
  check_unalignedassert_good<TestNew2>();
107
  check_unalignedassert_good<TestNew3>();
107
  check_unalignedassert_good<TestNew3>();
108
108
109
  check_unalignedassert_good<TestNew4>();
109
  check_unalignedassert_good<TestNew4>();
110
  check_unalignedassert_good<TestNew5>();
110
  check_unalignedassert_good<TestNew5>();
111
  check_unalignedassert_good<TestNew6>();
111
  check_unalignedassert_good<TestNew6>();
112
  check_unalignedassert_good<Depends<true> >();
112
  check_unalignedassert_good<Depends<true> >();
113
113
114
#if EIGEN_ALIGN_STATICALLY
114
#if EIGEN_ALIGN_STATICALLY
115
  if(EIGEN_ALIGN_BYTES==16)
115
  if(EIGEN_ALIGN_BYTES>=16)
116
  {
116
  {
117
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4f>(8));
117
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4f>(8));
118
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2d>(8));
118
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2d>(8));
119
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2cf>(8));
119
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector2cf>(8));
120
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4i>(8));
120
  }
121
  }
121
  for(int b=8; b<EIGEN_ALIGN_BYTES; b+=8)
122
  for(int b=8; b<EIGEN_ALIGN_BYTES; b+=8)
122
  {
123
  {
123
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8f>(b));
124
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector8f>(b));
124
    VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4f>(b));
125
    VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4f>(b));
125
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4d>(b));
126
    VERIFY_RAISES_ASSERT(construct_at_boundary<Vector4d>(b));
126
    VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix2d>(b));
127
    VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix2d>(b));
127
    VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4d>(b));
128
    VERIFY_RAISES_ASSERT(construct_at_boundary<Matrix4d>(b));
(-)a/test/vectorization_logic.cpp (-1 / +1 lines)
Lines 209-225 template<typename Scalar, bool Enable = Link Here
209
            >(InnerVectorizedTraversal,CompleteUnrolling)));
209
            >(InnerVectorizedTraversal,CompleteUnrolling)));
210
210
211
    VERIFY((test_assign<
211
    VERIFY((test_assign<
212
            Map<Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)>, Aligned, InnerStride<3*PacketSize> >,
212
            Map<Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)>, Aligned, InnerStride<3*PacketSize> >,
213
            Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)>
213
            Matrix<Scalar,EIGEN_PLAIN_ENUM_MAX(2,PacketSize),EIGEN_PLAIN_ENUM_MAX(2,PacketSize)>
214
            >(DefaultTraversal,CompleteUnrolling)));
214
            >(DefaultTraversal,CompleteUnrolling)));
215
215
216
    VERIFY((test_assign(Matrix11(), Matrix<Scalar,PacketSize,EIGEN_PLAIN_ENUM_MIN(2,PacketSize)>()*Matrix<Scalar,EIGEN_PLAIN_ENUM_MIN(2,PacketSize),PacketSize>(),
216
    VERIFY((test_assign(Matrix11(), Matrix<Scalar,PacketSize,EIGEN_PLAIN_ENUM_MIN(2,PacketSize)>()*Matrix<Scalar,EIGEN_PLAIN_ENUM_MIN(2,PacketSize),PacketSize>(),
217
                        PacketSize>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD?DefaultTraversal:InnerVectorizedTraversal, CompleteUnrolling)));
217
                        InnerVectorizedTraversal, CompleteUnrolling)));
218
    #endif
218
    #endif
219
219
220
    VERIFY(test_assign(MatrixXX(10,10),MatrixXX(20,20).block(10,10,2,3),
220
    VERIFY(test_assign(MatrixXX(10,10),MatrixXX(20,20).block(10,10,2,3),
221
      SliceVectorizedTraversal,NoUnrolling));
221
      SliceVectorizedTraversal,NoUnrolling));
222
222
223
    VERIFY(test_redux(VectorX(10),
223
    VERIFY(test_redux(VectorX(10),
224
      LinearVectorizedTraversal,NoUnrolling));
224
      LinearVectorizedTraversal,NoUnrolling));
225
225

Return to bug 973