Re: [eigen] Eigen AVX support - first steps

[ Thread Index | Date Index | More Archives ]

Hi Rohit,

thank you for the hard work.

On Sun, Apr 14, 2013 at 6:47 AM, Rohit Garg <rpg.314@xxxxxxxxx> wrote:
> I have pushed some code to the eigen-avx repository at bitbucket.
> a) All the additions reside in the AVX folder, along with altivec, neon and
> SSE. I have split up the single and double precision code into two files as
> one file was getting too big.

I'm not sure decoupling float and double really helps readability
since in 99% of the cases they should be extremely similar, but ok.

> b) The integer code has been removed as AVX does not have int support. Once
> real numbers are done, we can move on to complex number support.

indeed, that's for AVX2 that should be available in coming soon CPUs.

> c) I had a few questions about some of the intrinsic functions, I have
> written them in the questions.txt file. in the AVX folder.

I'll answer them in a second email.

> d) So far, I have just migrated the intrinsic functions from SSE over to
> AVX. All my changes are so far limited to the AVX folder in the arch folder.
> I have not run any tests and this code is not hooked up to the rest of the
> eigen code base as yet. The reduction functions have been tested separately,
> so they should be fine.

Look at the Eigen/Core header file. Before testing for SSE, if __AVX__
is defined then we should define a EIGEN_VECTORIZE_AVX token that will
be used later to include your files instead of the ones in SSE. Then,
in CMakeLists.txt, you can add an option to enable AVX in unit tests,
and start with the packet_math unit tests.

I guess we well also have to move the alignement requirement to the
packet_traits instead of the somewhat hardcoded 16 bytes. For initial
testing though, you can make sure that pload and pstore also work on
16bytes aligned data.

> e) I have made no attempt for micro-optimization so far. Once this works we
> can move to optimization.



> f) Code review welcome. :)
> Cheers,
> --
> Rohit Garg
> Graduate Student
> Applied and Engineering Physics
> Cornell University

Mail converted by MHonArc 2.6.19+