Re: [eigen] Eigen::Complex -- does it have a reason to exist?

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


Benoit Jacob wrote:
There is still a problem: so far, we use the criterion "a packet
consists of a single scalar", formulated
ei_packet_traits<Scalar>::Size==1, to determine if a scalar type
doesn't have vectorization. This test breaks on complex<double> as its
sizeof is 16, so we need a more future-proof test.

I think the benefits of explicitly optimizing std::complex<double> with SIMD intrinsics/asm would be fairly small for exactly the reason you specify: there is exactly one complex<double> in a 128 bit simd register. This should be child's play for a compiler. The only problem I can think of is that the compiler might not assume 16 byte alignment of complex<double>. We may be able to work around that with __attribute__((__vector_size__(16)))

DANGER ZONE: I am speculating without the benefit of benchmarks. Does anyone have any concrete knowledge to either support or refute my speculation?


Thanks a lot for this observation. I am sorry for having suggested you
to work on something we may end up not using after all, and I
appreciate a lot that you brought this issue up!
I don't think you really suggested it, at least not very strongly. I was mainly curious to see if the idea would work to have an 'operator &' that returns a struct that is convertible to one of two pointer types. Although the basic idea is sound, I would not consider it a success. I thought I should be the one to kill it, since I gave birth to the monster.

That is, unless someone can come up with a good reason for it to exist. Going once... Going twice ....








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