Re: [eigen] Support for true Array |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Support for true Array
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 25 Nov 2009 08:42:42 -0500
- 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=V/aog2rarEHKjLcJCuNzrweSxejvz6lOjWN72rIQYr4=; b=B/1L/XAvw7QgXgmeow0pJ6UYDIble84LPCsru+oPUfcez/aMuXhCLH/aYZLF2g7Ur7 jdUuw2jTStr9+m5mOcaf9I/StNsKfzUS8LqXwQmVQCjL+KComEZcblfSWR3Cx3XZFEU6 SBvgyjXWfAcDhwCEfwYm8472CwSnWI2vtadh0=
- 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=TaEBL8/xiEtuDFqndwMpues5eUh0XfPeISzHVvkVxDrZZluhNXP+cPtLRpioIp/nqN +cnRcxCIZ6UlGoYvFUrEsARmXAVTgh9KOrRojUqLxI1b4SHuo4dlocnUu09+uOwYNLq5 3dysnRlOkS1KEXlEWLi0vgtUBEeJGmECTufS4=
2009/11/25 Rohit Garg <rpg.314@xxxxxxxxx>:
> Array Of Structures - AoS
> ===================
> struct float2{
> float x,y};
>
> float2 arr[N];
>
> Structure Of Arrays - SoA
> ===================
> struct float2
> {
> float x[N],y[N];}
>
> SOA form has *big* advantages for simd ops over aos.
Yes indeed; so: AoS is what we had so far in Eigen; SoA is what we'll
get thanks to the new Array class, when using e.g. Matrix<Array,3,1>.
Benoit
>>
>> This is about creating an Array class that can be used as a scalar
>> type, and on which the arithmetic ops are vectorized. So when you have
>> Matrix<Array,3,1> u,v,w;
>> and you do:
>> u = v+w;
>> this expands (thanks to Eigen xpr templates and unrollers) to:
>> u[0] = v[0]+w[0];
>> u[1] = v[1]+w[1];
>> u[2] = v[2]+w[2];
>> Each of these 3 lines is now an operation on Array objects and expands
>> to a vectorized loop doing the addition.
>>
>> Benoit
>>
>>
>>
>
>
>
> --
> Rohit Garg
>
> http://rpg-314.blogspot.com/
>
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology
> Bombay
>
>
>