Re: [eigen] Map: introduce "AlignedPointer" flag? |
[ Thread Index |
Date 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, 29 Oct 2009 19:02:11 -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=vfJLCttJWW1Y1VJ5fb+PP3qowvNl/vHYUfags1mZsp0=; b=ZKuz1mQvxos6f+d4Nf/oT8Br1OkYZjhHbisit1q9BT9nc+P9f43m1cJTAzi6E7jIP7 B7KF7rN4oTvYs4rm1XXCdA5tleXHsWvax3PhE4t5lhgraN7JZodrpbZF1lRKzLx5ZR5d 0oa35DLLHmiethwNzRRzepDmhqxU5j+IMJmr8=
- 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=qRdH/+jglDL1tqVJQb1255vVtvgXDSIo1lrPgTRzJA2hB8/v1/dPlgH4fBEihQsW1B 0evADR4Thn/IM0JL8fJSBHDDmhQy6q6LrUWKSD6Oz3zXurB4T57R5jHveJR6CInsCyjJ OdjIIdxBpGqtfk3j1QITGvy/ppLwNH0U/W7Gk=
Apparently you changed Force ---> Enforce in the name?
I'm no native English speaker but i have the impression that Force is
really what is meant here. Force means the same as in french,
"forcer". Enforce means "mettre en vigueur". The difference is that
Force means that _you_ force a behavior, it makes it clear that it
could be unsafe. Also Enfore seems to refer to an existing "rule"
(typically one talks about enforcing a law, etc)
(Better English speakers, feel free to correct me...)
Benoit
2009/10/23 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>
> ok, I committed that change, but I simply reused the Unaligned / Aligned
> constants, e.g:
>
> EIGEN_ALIGN16 float f[4];
> Map<Vector4f,Aligned> mv(v);
>
> gael.
>
> On Thu, Oct 22, 2009 at 5:50 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> 2009/10/22 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>> >
>> >
>> > On Wed, Oct 21, 2009 at 4:10 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
>> > wrote:
>> >>
>> >> 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
>> 16)".
>>
>> >
>> > 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 +
>> > other;
>> >
>> > 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.
>>
>> Benoit
>>
>>
>> >
>> > I'm also ok to rename it to ForceAlignedAccess.
>> >
>> > gael
>> >
>> >
>> >>
>> >> If you tell me all that I can try to get that done ;)
>> >>
>> >> Benoit
>> >>
>> >
>>
>>
>
>
>
>