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

[ Thread Index | Date Index | More Archives ]

2009/8/20 Rohit Garg <rpg.314@xxxxxxxxx>:
> Hi,
> What is the state of eigen's support for small integers(16 bit,
> signed/unsigned). I had a look at the  branch over at bitbucket, and
> there doesn't seem to be any small int specific patches in it.
> Any body care to comment on the state of this branch?

Only Patrick can comment on his own branch;)

> If I need to add support for small ints to eigen, what do I need to
> do? I need all bitwise ops, and yes, 16 bit*16 bit =  32 bit unsigned
> integer multiplication (vectorized of course). Suggestions?

First, read this,
The two most important things are to edit the files NumTraits.h and
MathFunctions.h in Core/.

For vectorization, you'll have to edit the files in Core/arch/... at
least Core/arch/SSE/PacketMath.h. Not sure about how it works for
small ints (are there specific SSE instructions for e.g. adding two
packets of 8 int16's ? you know better than me)

For the bitwise ops, in the non-vector case i don't think you need to
do anything special since operators & |... work natively; you can
always check the Functors.h either in Core/ or in Array/ ; for
vectorization I'm very optimistic too -- we already have ei_pand(),
ei_por() etc in PacketMath.h and since for bitwise ops the integer
size is irrelevant, you should be able to use that.

> BTW, are such features even welcome in eigen?

Yes, most welcome. When I look at forums linking to our website, this
is a frequently wanted feature. The fact that people on this list
asked for it several times, finishes proving that it's a wanted
feature. Vectorization is most welcome here too -- the prospect of 8x
boosts on int16 and 16x boosts on int8 is very interesting...


Mail converted by MHonArc 2.6.19+