Re: [eigen] How do you link multiple versions (e.g. AVX vs SSE) of the same Eigen code?

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


Benoit, Gael, could you confirm that this change is intentional?

Pro:
  improves perf of certain 4d ops
Con:
 - regresses perf of 4f ops, as now Vector4f isn't aligned anymore!!!!
 - breaks long-standing invariant that Eigen ABI is independent of compile flags

Benoit

2015-01-27 18:22 GMT-05:00 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
Ouch... you're right. From Macros.h:

  #if defined(__AVX__)
    #undef EIGEN_ALIGN_BYTES
    #define EIGEN_ALIGN_BYTES 32
  #endif



2015-01-27 18:19 GMT-05:00 Benoit Jacob <jacob.benoit..1@xxxxxxxxx>:

Oh --- I was still living in a world where the Eigen ABI is unaffected by vectorization, which was the case at least until AVX.

Is alignof(Vector4d) actually 32 with AVX by default? So ABI is now dependent on compile flags?

Benoit

2015-01-27 18:17 GMT-05:00 Marc Glisse <marc.glisse@xxxxxxxx>:

On Tue, 27 Jan 2015, Benoit Jacob wrote:

An approach that works is to #define Eigen EigenAVX, but this is very
annoying because you can't anymore pass around Eigen objects, you have to
somehow reinterpret_cast them to EigenAVX objects.

I would expect EigenAVX::Vector4d to have an alignment of 32, and only 16 for EigenSSE::Vector4d (I did not check), which would mean they really are different types and you cannot pass the second one to a function expecting the first. So I am not sure how you intend to "pass around Eigen objects".

--
Marc Glisse







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