[ 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'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 "Wrapper&q=
uot; are to to wrap any expressions (including a Map<>) 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<typename _Scalar, int Alignment><b=
r>class Map<Quaternion<_Scalar>, Alignment> : public Quaternion=
Base<...><br>
{<br>=C2=A0// current QuaternionWrapper's code goes here<br>};<br><br>U=
ser code would look like:<br><br>float data[4];<br>Map<Quaternionf,Align=
ed> 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<X=
prType> class QuaternionWrapper : public QuaternionBase<...><br>
{<br>};<br><br>Though I don'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"><<a href=3D"mailto:jacob.benoit.1@xxxxxxxxx">jacob.ben=
oit.1@xxxxxxxxx</a>></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 <<a href=3D"mailto:mathieu.gautier@xxxxxx">mathieu.gautier@cea=
..fr</a>>:<br>
<div class=3D"im">> Actually the multiplication of two quaternions is no=
t vectorized? Are you<br>
> 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>
><br>
> As usual, I have some questions :) I don't understand the differen=
ce in your<br>
> enum between :<br>
><br>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0enum { Unaligned=3D0, Aligned=3D1 };<br>
> and =C2=A0 =C2=A0 enum { AsRequested=3D0, EnforceAlignedAccess=3D2 };<=
br>
<br>
</div>See Gael'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's<br=
>
what you want. EnforceAlignedAccess is a different thing, it's<br>
internal, ignore it.<br>
<div class=3D"im"><br>
><br>
> Aligned is used In map in test/map.cpp :<br>
><br>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0VectorType ma1 =3D Map<VectorType, Align=
ed>(array1, size);<br>
<br>
</div>So here we are saying "array1 is an aligned pointer, feel free t=
o use<br>
that information when vectorizing the code".<br>
<div class=3D"im"><br>
><br>
> and AsRequested is used in ForwardDeclarations.h as the default argume=
nt for<br>
> 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>
><br>
> Does it means that "AsRequested" and "Unaligned" a=
re equivalent ?<br>
<br>
</div>This is a bit field, these 2 values represent the corresponding bit<b=
r>
being 0, but it's not the same bit.<br>
<div class=3D"im"><br>
> Because I<br>
> am actually not comfortable how to use PacketAccess and which value to=
<br>
> 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--