Added initial experimental support for explicit vectorization.

Currently only the following platform/operations are supported:
 - SSE2 compatible architecture
 - compiler compatible with intel's SSE2 intrinsics
 - float, double and int data types
 - fixed size matrices with a storage major dimension multiple of 4 (or 2 for double)
 - scalar-matrix product, component wise: +,-,*,min,max
 - matrix-matrix product only if the left matrix is vectorizable and column major
   or the right matrix is vectorizable and row major, e.g.:
   a.transpose() * b is not vectorized with the default column major storage.
To use it you must define EIGEN_VECTORIZE and EIGEN_INTEL_PLATFORM.
This commit is contained in:
Gael Guennebaud
2008-04-09 12:31:55 +00:00
parent 4920f2011e
commit 1985fb0551
25 changed files with 436 additions and 93 deletions

View File

@@ -59,6 +59,8 @@ template<typename Derived> class MatrixBase
//@{
typedef typename ei_traits<Derived>::Scalar Scalar;
typedef typename ei_packet_traits<Scalar>::type PacketScalar;
enum {
RowsAtCompileTime = ei_traits<Derived>::RowsAtCompileTime,
@@ -211,6 +213,9 @@ template<typename Derived> class MatrixBase
Scalar& coeffRef(int index);
Scalar& operator[](int index);
PacketScalar packetCoeff(int row, int col) const { return derived()._packetCoeff(row,col); }
void writePacketCoeff(int row, int col, const PacketScalar& x) { return derived()._writePacketCoeff(row,col,x); }
const Scalar x() const;
const Scalar y() const;
const Scalar z() const;
@@ -484,6 +489,11 @@ template<typename Derived> class MatrixBase
{ return *static_cast<Derived*>(const_cast<MatrixBase*>(this)); }
//@}
private:
PacketScalar _packetCoeff(int , int) const { ei_internal_assert(false && "_packetCoeff not defined"); }
void _writePacketCoeff(int , int, const PacketScalar&) { ei_internal_assert(false && "_packetCoeff not defined"); }
};
#endif // EIGEN_MATRIXBASE_H