|Re: [eigen] Map: introduce "AlignedPointer" flag?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Map: introduce "AlignedPointer" flag?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 22 Oct 2009 11:50:23 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Fk3I0kCcFndraP3H3J85UBR2kihNo66BrW3ETDVp5p8=; b=tFjE83Vnr5rXF6xgJurY07Kj8I7VOvpexnMTGp07mMAX71cvOwAOtdE6iltqrmquWo E9t4VO2QlcOKhonGKipYLBI2uJ6z1xCBcZuN2QYjjqlguYasbGw0aUoe50xgAOp2gf95 sSTcs3wV+ZcW9VZXZw0+8U0L5J6zmDjJGvwrA=
- 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=ClaGfO+1k2w2o//cTc5gsPqBQRlABek0yyIp2wyRRKBL8DC/6MeFpsrY33cNevNyC3 NQI6hrMOUcw/vzA37h7d1h2e7SrmPo+qpz6O8x7DisRt8DRqsvtfyVpMEcnTsijX988x JEtVj7SVRhtWb/7ITCp+i678i0l7+Hqi7GqRQ=
2009/10/22 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> On Wed, Oct 21, 2009 at 4:10 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
>> This is for Gael. Currently in Map, what's the precise meaning of
>> "ForceAligned" ? Is it:
>> " If you use packet access, then use aligned packet access " ?
>> If yes, is it correct to say that at the moment we don't offer any way
>> to tell that the pointer passed to Map is aligned, and that therefore
>> we may enable packet access also e.g. for good fixed sizes? I remember
>> you saying something like "we need a FirstAligned flag", were you
>> talking about that? What do you think about calling that
>> AlignedPointer and renaming ForceAligned to ForceAlignedAccess ?
>> Finally, can you remind me what the use case for ForceAligned is, if
>> we have AlignedPointer?
> yes this issue was on my todo list as well.
oh, if it is, i'll gladly let you do it! You are more informed than me
on this class since you basically rewrote it.
> So basically we could add an
> AlignedPointer option to Map setting the AlignedBit flag. That's it I think.
I think you also need to carefully set PacketAccessBit to something
like "If AlignedBit AND (either dyn-size OR fixed size multiple of
> About ForceAligned, it is only used internally, and its purpose is to avoid
> unligned loads in such cases:
> a += b;
> where a is a Map or a Block object.
> Indeed, since a += b; is transformed to "a = a + b;" and that in assign we
> make sure that stores to "a" will be aligned, we know that loads from "a"
> will be aligned too but we need a way to enforce that. The solution is to
> reimplement operator += in MapBase (inherited by Block and Map) like this:
> *this = *this_cast_to_the_same_type_but_with_the_ForceAligned_option +
> I agree that's probably more useful for Block than for Map, but since they
> share the same code...
I see! thanks for the explanation.
> I'm also ok to rename it to ForceAlignedAccess.
>> If you tell me all that I can try to get that done ;)