Re: [eigen] State of eigen support for small integers(16 bit, signed/unsigned)

[ Thread Index | Date Index | More Archives ]

2009/8/21 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> On Fri, Aug 21, 2009 at 2:34 PM, Benoit Jacob<jacob.benoit.1@xxxxxxxxx> wrote:
>> 2009/8/21 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>>> one more information, if you want the coeff wise product of two int16
>>> returns a int32, you can simply add the specialization:
>>> template<> struct ei_scalar_product_traits<int16,int16> { typedef
>>> int32 ReturnType; };
>>> Also for the vectorization I think there is no other choice than using
>>> structs instead of typdefs for the PacketXX SSE types because we need
>>> to distinguish, e.g.:
>>> ei_padd(Packet4i,Packet4i)
>>> and
>>> ei_padd(Packet8s,Packet8s)
>>> so here Packet4i and Packet8s *must* be different types.
>> Depends: in the other solution, this is remedied by making ei_padd
>> template in the scalar type, so the first is the specialization for
>> int and the second is the specialization for short.
> hm actually we must have both ei_padd<float>(float,float) and
> ei_padd<Packet4f>(Packet4f,Packet4f) so I don't think solution (a)
> could work.

Well then make ei_padd template in both the scalar type and the packet type.

That's really what i had in mind when I half expected this to be too
cumbersome ;)

So indeed the other solution looks better at this point.


Mail converted by MHonArc 2.6.19+