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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 3 Sep 2010 10:28:15 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=aMXBlilbdPH15mFCge967TBeNJBtRsuZzYxkCyEVh4k=; b=KSx6FpPPuz0HTWiWsO5s1n05PXg9l2r7S4QxOaRMlkNG5qormWnoRwlyT681bXsXgJ Yf2HUY1X0V19QH44CKrFLJOevBftSzRumD0VCwW5UamFvDyGz8pMS0nVoknYBC/D7p+2 O/3ZMOWlA37TnUlbzlKrrQPNORpLk0BZE/9Xw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lvWAJRst+U7Td+rLa54z913KfOqZbm4oy6EMpAZ5NEGugCDVqGOgEbO8/Y6kr9IlWA URBhIUCINrixUBasbVI6EifTrgZKdNUVFjFxCheURZIDKUdJuyHKaaZF7ehIXKJ4FO1n 4Y9gFFrbFXDBGfkCYKNib8NgEX2PBdADEwWHc=
2010/9/3 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> On Fri, Sep 3, 2010 at 1:50 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>> 1. Gael makes me understand something I was missing above.
>
> Let me try to be more specific. Consider the following high level construct:
>
> (A<B).select(C,D)
>
> (we could add others if needed).
>
> This returns a Select<ConditionType,ThenType,ElseType> here
> ThenType==C, ElseType==D, and ConditionType is a binary expression.
>
> At compile time, Select checks that ConditionType::Scalar==bool and
> ThenType::Scalar==ElseType::Scalar.
> Then, still at compile time, it asks ConditionType if it can returns
> pseudo boolean packets compatible with ThenType::Scalar. For instance
> A and B could be matrices of float while C and D contains doubles.
> These packets are obtained through packet<Alignment,PacketType>(i,j).
> Recall that in another thread we found that the packet functions had
> to be templated on the packet type to support engines supporting
> various packet size for the same scalar type.
> If everything is ok, then this Select expression is marked as
> Vectorizable. Problem solved.
OK! I hadn't understood that you agreed with the need to have
pseudo-bools-the-size-of-Scalar somewhere down the chain. And I didn't
have your clever idea of where to put that. So basically the
expression has officially Scalar==bool but can be queried to get
pseudo-bools-the-size-of-Scalar instead, using a separate coeff
accessor. Great, that works for me.
Thanks for the explanation.
Benoit
> Then we could add special versions of this select mechanism to
> optimize cases where C or D is equal to zero. We could add a special
> Zero expression which as no specific sizes nor scalar type, but always
> return zero with overloads for common operators. Then we could
> specialize and fully optimize select(C,Zero) etc.
>
> Can you show me specific use cases that would not be covered by that ?
>
> gael
>
>
>