mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* Started support for unaligned vectorization.
* Introduce a new highly optimized matrix-matrix product for large matrices. The code is still highly experimental and it is activated only if you define EIGEN_WIP_PRODUCT at compile time. Currently the third dimension of the product must be a factor of the packet size (x4 for floats) and the right handed side matrix must be column major. Moreover, currently c = a*b; actually computes c += a*b !! Therefore, the code is provided for experimentation purpose only ! These limitations will be fixed soon or later to become the default product implementation.
This commit is contained in:
@@ -116,21 +116,36 @@ class Matrix : public MatrixBase<Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows,
|
||||
return m_storage.data()[row + col * m_storage.rows()];
|
||||
}
|
||||
|
||||
template<int LoadMode>
|
||||
PacketScalar _packetCoeff(int row, int col) const
|
||||
{
|
||||
ei_internal_assert(Flags & VectorizableBit);
|
||||
if(Flags & RowMajorBit)
|
||||
return ei_pload(&m_storage.data()[col + row * m_storage.cols()]);
|
||||
if (LoadMode==Aligned)
|
||||
return ei_pload(&m_storage.data()[col + row * m_storage.cols()]);
|
||||
else
|
||||
return ei_ploadu(&m_storage.data()[col + row * m_storage.cols()]);
|
||||
else
|
||||
return ei_pload(&m_storage.data()[row + col * m_storage.rows()]);
|
||||
if (LoadMode==Aligned)
|
||||
return ei_pload(&m_storage.data()[row + col * m_storage.rows()]);
|
||||
else
|
||||
return ei_ploadu(&m_storage.data()[row + col * m_storage.rows()]);
|
||||
}
|
||||
|
||||
template<int StoreMode>
|
||||
void _writePacketCoeff(int row, int col, const PacketScalar& x)
|
||||
{
|
||||
ei_internal_assert(Flags & VectorizableBit);
|
||||
if(Flags & RowMajorBit)
|
||||
ei_pstore(&m_storage.data()[col + row * m_storage.cols()], x);
|
||||
if (StoreMode==Aligned)
|
||||
ei_pstore(&m_storage.data()[col + row * m_storage.cols()], x);
|
||||
else
|
||||
ei_pstoreu(&m_storage.data()[col + row * m_storage.cols()], x);
|
||||
else
|
||||
ei_pstore(&m_storage.data()[row + col * m_storage.rows()], x);
|
||||
if (StoreMode==Aligned)
|
||||
ei_pstore(&m_storage.data()[row + col * m_storage.rows()], x);
|
||||
else
|
||||
ei_pstoreu(&m_storage.data()[row + col * m_storage.rows()], x);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user