Re: [eigen] AVX integer and half-packet support (was Altivec port status)

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]





On Tue, Jul 15, 2014 at 3:19 PM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On 15.07.2014 10:10, Christoph Hertzberg wrote:
My change actually exposes that integer vectorization with AVX is
somewhat undefined. We provide Packet8i but don't implement
vectorization, since it's only available with AVX2:
http://manao.inria.fr/CDash/testDetails.php?test=2551040&build=13031

The problem is that the alignment_bit in Matrix::Flags is set if
  (((MaxCols*MaxRows*int(sizeof(Scalar))) % EIGEN_ALIGN_BYTES) == 0))
This should actually be dependent on packet_traits<Scalar>::size not EIGEN_ALIGN_BYTES. And actually, if HasHalfPacket==1, we should also enable vectorization if the number of elements is a multiple of half that size or we unnecessarily lose a lot of performance for small objects. I'm aware that this will make things complicated ... :(

Yes, we are aware since the apparition of AVX that we will have to completely rewrite some parts of the vectorization logic:
1 - choice of the best alignment requirements in DenseStorage,
2 - expose the actual alignment of an _expression_,
3 - choice of the best packet size to evaluate an _expression_,
4 - extend the packet/writePacket members to allow for multiple packet-sizes,
5 - Extend the second template parameter of Map to enable partial alignment..
6 - etc.

Regarding 1 & 3 I think that the recursive structure offered by the HasHalfPacket/half type should be enough (of course we have to write the respective logic recursively).

Regarding 2, the aligned bit flag is not enough anymore, and we'll probably have to add a new enum (like CoeffReadCost).

gael
 


Christoph


--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/