Re: [eigen] Map/Block equivalence and vectorization

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


Hi,

On Thu, Jul 19, 2012 at 11:20 AM, Márton Danóczy <marton78@xxxxxxxxx> wrote:
> Dear list,
>
> I have some questions regarding the following snippet:
>
> ArrayXXf arr(100, 100);
> Block<ArrayXXf> blk(arr, 1, 0, 99, 100);
> Map<ArrayXXf> map(arr.data()+1, 99, 100); // needs Aligned?
>
> 1) Is using Block and Map completely equivalent?

here yes.

> 2) Will operations on both be vectorized, even though the first
> element is not aligned? That is, will Eigen perform scalar
> calculations on the first 3 elements of map/blk and vectorize the
> rest?

exactly.

> 3) What happens if Map is passed a completely odd adress, such as
> ((char*) arr.data()) + 1, will it break or simply never vectorize?

This cannot work, even without vectorization. For instance:

float* a;
float b;
b = *a;

won't work if a is not 4 bytes aligned.

> 4) Does Map<ArrayXXf, Aligned> mean aligned to float or to 4 floats?

aligned to 16 bytes.

cheers,
gael

>
> Thanks for your time,
> Marton
>
>



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