[no subject]

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




Then in the future we could still re-introduce QuaternionWrapper to actually
wrap any expression as a Quaternion:

template<XprType> class QuaternionWrapper : public QuaternionBase<...>
{
};

Though I don't think that such a QuaternionWrapper is really needed, perhaps
in the future... who knows.

gael.



On Mon, Oct 26, 2009 at 8:02 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>wrote:

> 2009/10/26 Mathieu Gautier <mathieu.gautier@xxxxxx>:
> > Actually the multiplication of two quaternions is not vectorized? Are you
> > refering to the version proposed by Rohit in the archives ?
>
> it is, for float. Check the specialization in
> Eigen/src/Geometry/arch/Geometry_SSE.h.
>
> >
> > As usual, I have some questions :) I don't understand the difference in
> your
> > enum between :
> >
> >        enum { Unaligned=0, Aligned=1 };
> > and     enum { AsRequested=0, EnforceAlignedAccess=2 };
>
> See Gael's explanations in the other thread. Aligned means that you
> certify that the pointer that you pass to Map will be aligned.That's
> what you want. EnforceAlignedAccess is a different thing, it's
> internal, ignore it.
>
> >
> > Aligned is used In map in test/map.cpp :
> >
> >        VectorType ma1 = Map<VectorType, Aligned>(array1, size);
>
> So here we are saying "array1 is an aligned pointer, feel free to use
> that information when vectorizing the code".
>
> >
> > and AsRequested is used in ForwardDeclarations.h as the default argument
> for
> > PacketAccess.
>
> Well AsRequested is 0 anyway. To make things clear the default
> argument could be explicitly 0 as it is always important that default
> values of bitfields be 0, regardless of what they mean, so that one
> doesnt have to OR with the default value when one just wants to change
> 1 bit.
>
> >
> > Does it means that "AsRequested" and "Unaligned" are equivalent ?
>
> This is a bit field, these 2 values represent the corresponding bit
> being 0, but it's not the same bit.
>
> > Because I
> > am actually not comfortable how to use PacketAccess and which value to
> > provide to QuaternionWrapper.
>
> In case of an aligned pointer, pass Aligned to Map.
> Otherwise, pass 0 to Map.
>
> I havent yet checked your new patch. if you could send a unique
> combined patch (see other mail) that would help. Also tell me if after
> these answers there are changes that you want to make before i
> reexamine the code.
>
> Benoit
>
>

--000e0ce0eea8e7b5500476dd35a3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br>Sorry I don&#39;t have much time to follow this development, but it see=
ms that in the current patch QuaternionWrapper would be only to map a float=
* (or double*) as a Quaternion, right ? while other uses of &quot;Wrapper&q=
uot; are to to wrap any expressions (including a Map&lt;&gt;) as something =
else (e.g. a DiagonalMatrix).<br>
<br>So instead of QuaternionWrapper, what about using a specialization of M=
ap for Quaternion:<br><br>template&lt;typename _Scalar, int Alignment&gt;<b=
r>class Map&lt;Quaternion&lt;_Scalar&gt;, Alignment&gt; : public Quaternion=
Base&lt;...&gt;<br>
{<br>=C2=A0// current QuaternionWrapper&#39;s code goes here<br>};<br><br>U=
ser code would look like:<br><br>float data[4];<br>Map&lt;Quaternionf,Align=
ed&gt; q(data);<br><br>Maybe this look more natural ?<br><br>From a practic=
al point of view, this requires to change only 1 or 2 lines in your patch.<=
br>
<br><br><br><br>Then in the future we could still re-introduce QuaternionWr=
apper to actually wrap any expression as a Quaternion:<br><br>template&lt;X=
prType&gt; class QuaternionWrapper : public QuaternionBase&lt;...&gt;<br>
{<br>};<br><br>Though I don&#39;t think that such a QuaternionWrapper is re=
ally needed, perhaps in the future... who knows.<br><br>gael.<br><br><br><b=
r><div class=3D"gmail_quote">On Mon, Oct 26, 2009 at 8:02 PM, Benoit Jacob =
<span dir=3D"ltr">&lt;<a href=3D"mailto:jacob.benoit.1@xxxxxxxxx";>jacob.ben=
oit.1@xxxxxxxxx</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/10/26 Mathie=
u Gautier &lt;<a href=3D"mailto:mathieu.gautier@xxxxxx";>mathieu.gautier@cea=
..fr</a>&gt;:<br>

<div class=3D"im">&gt; Actually the multiplication of two quaternions is no=
t vectorized? Are you<br>
&gt; refering to the version proposed by Rohit in the archives ?<br>
<br>
</div>it is, for float. Check the specialization in<br>
Eigen/src/Geometry/arch/Geometry_SSE.h.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; As usual, I have some questions :) I don&#39;t understand the differen=
ce in your<br>
&gt; enum between :<br>
&gt;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0enum { Unaligned=3D0, Aligned=3D1 };<br>
&gt; and =C2=A0 =C2=A0 enum { AsRequested=3D0, EnforceAlignedAccess=3D2 };<=
br>
<br>
</div>See Gael&#39;s explanations in the other thread. Aligned means that y=
ou<br>
certify that the pointer that you pass to Map will be aligned.That&#39;s<br=
>
what you want. EnforceAlignedAccess is a different thing, it&#39;s<br>
internal, ignore it.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; Aligned is used In map in test/map.cpp :<br>
&gt;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0VectorType ma1 =3D Map&lt;VectorType, Align=
ed&gt;(array1, size);<br>
<br>
</div>So here we are saying &quot;array1 is an aligned pointer, feel free t=
o use<br>
that information when vectorizing the code&quot;.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; and AsRequested is used in ForwardDeclarations.h as the default argume=
nt for<br>
&gt; PacketAccess.<br>
<br>
</div>Well AsRequested is 0 anyway. To make things clear the default<br>
argument could be explicitly 0 as it is always important that default<br>
values of bitfields be 0, regardless of what they mean, so that one<br>
doesnt have to OR with the default value when one just wants to change<br>
1 bit.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; Does it means that &quot;AsRequested&quot; and &quot;Unaligned&quot; a=
re equivalent ?<br>
<br>
</div>This is a bit field, these 2 values represent the corresponding bit<b=
r>
being 0, but it&#39;s not the same bit.<br>
<div class=3D"im"><br>
&gt; Because I<br>
&gt; am actually not comfortable how to use PacketAccess and which value to=
<br>
&gt; provide to QuaternionWrapper.<br>
<br>
</div>In case of an aligned pointer, pass Aligned to Map.<br>
Otherwise, pass 0 to Map.<br>
<br>
I havent yet checked your new patch. if you could send a unique<br>
combined patch (see other mail) that would help. Also tell me if after<br>
these answers there are changes that you want to make before i<br>
reexamine the code.<br>
<font color=3D"#888888"><br>
Benoit<br>
<br></font></blockquote></div><br>

--000e0ce0eea8e7b5500476dd35a3--



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