Re: [eigen] AVX/LRB and SSE with SoA support |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] AVX/LRB and SSE with SoA support*From*: keller <christoph-keller@xxxxxx>*Date*: Fri, 03 Sep 2010 11:25:25 +0200

On 09/02/2010 10:56 AM, Gael Guennebaud wrote:

On Wed, Sep 1, 2010 at 9:23 PM, keller<christoph-keller@xxxxxx> wrote:On 08/23/2010 08:53 PM, Gael Guennebaud wrote:well, Eigen is a general purpose math library and so such "hacks" does not match well with our objectives. We have to find a better solution.Hi, If one wants to use the Vector units of the processor and store masks for comparisons, the comparison operators cannot return values of type bool.The problem is that we cannot know in advance whether a comparison should return bools or bitmasks. Also the nature of the bitmasks depends on the underlying vectorization engine. So the idea is to have powerful high level expressions such that there is no need to expose special scalar types. For instance, in: c = (a< b).select(x,y);

Well, as is said before: I dont't think this is flexible enough

returns an expression of bool, not a matrix of bool, and so vectorization is still possible. Then when we call select on it we can known whether this whole expression can be vectorized. If so we would generate something like: c(i) = ei_pselect(ei_plt(a(i),b(i)),x(i),y(i)); where ei_pselect would be implemented in term of pand/pnotand,por for SSE2 and 3, and using BLENDVP* with SSE4. Note that the BLENDVP* instructions read only the first bit and are therefore much more flexible.

Maybe it is possible to define a type EigenBool<type T, int VEC_ENGINE>

-with sth. like toBool(), which returns a normal bool -with sth. like toVecBool(), which returns a mask in format VEC_ENGINE -these can be templatized with a function toEBool<EigenBoolType>

-The systax can be like your select syntax -If one wants to store normal bool types with sth. like this Matrix<bool,...> = (a < b)

This just an idea, i dunno if it would work like this. Greetings, Christoph

**Follow-Ups**:**Re: [eigen] AVX/LRB and SSE with SoA support***From:*Benoit Jacob

**References**:**Re: [eigen] AVX/LRB and SSE with SoA support***From:*keller

**Re: [eigen] AVX/LRB and SSE with SoA support***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Why no LU::solveInPlace()?** - Next by Date:
**Re: [eigen] find command or equivalent** - Previous by thread:
**Re: [eigen] AVX/LRB and SSE with SoA support** - Next by thread:
**Re: [eigen] AVX/LRB and SSE with SoA support**

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