Re: [eigen] Map/Block equivalence and vectorization |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Map/Block equivalence and vectorization
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 20 Jul 2012 18:59:47 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=I0duKs074jL68POlk8gdX4NbSiRj8Riun7peyCLmpYs=; b=gS9n+7ddgdgP5vAY2CEq2VPDqQFFCCC0Ni+ap2OxUg+S2HgfjKOcKUrgWBN4QNzJVf ErfmQqE8tPlUL1cw37IUG5B4RtBvbsS0+BZ6nPnBwswgzyJSIJEcCevxTux3iO5+1+hZ /8+YRZJk9dI+iTJim9HiRJb6W1/NHTFnN+/o3i5G/VImw+xwp0tPssyuMY3UpuTpFylu FhgcDDOV28qnOn0pDiJX05gqreVV/2tuwcq2v3mnovnkuUNgpR701/xqI4L+TfazzML9 xANuroCoB45giTchtsuzlnCQ169lGI5/22ny7TYdCjpKivtVlWTIGvUYCgpojXFMUkdI 6P2A==
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
>
>