Re: [eigen] UnalignedArrayAssert and EIGEN_DONT_VECTORIZE |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] UnalignedArrayAssert and EIGEN_DONT_VECTORIZE
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 8 Sep 2009 12:12:19 -0400
- 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=Hjicl2S7fhxsit3FI+JggnE9Q2zKzChxdDalr6xXWys=; b=aMBkKkPAL5e0M4aHzH2LR9myW1FDWdM9WsD7GljyRe5OgKNb530WZ1ii3O1zQ2LQFm jweLDfSRsGzmH+WMTkdmL1Zg3t/VhawbF5Rsd1P3PZ9+9Y5EcAg4QKXfVsOdKby23fWK bpZIvW4UyH1QhGCubFENJe3eEt4B64ZW37N64=
- 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=kCuCEJDb0CaQMUEov5zXJ5Qhirkc3h6vjNVkWCj6X0TQKJWPAvgJpO0KJYo2fAFra7 Zu4nlgFDFo+8vZ0E/vhFoEyd4Hzb9jP+2zU4HB7Lia9uXS2ZAaQdFPy8hxrEfai6y+eo 30sVV7W75dDlTtzrDeJy8/8iNvq7AeWQKMZAA=
2009/9/8 Staffan Gimåker <staffan@xxxxxxxxxx>:
> Hi,
>
> I'm trying to use Eigen with the explicit vectorization features
> disabled, but I'm having some problems with
> "UnalignedArrayAssert" (curiously, it's only reproducible when running
> under Valgrinds memcheck tool).
>
> If I understand correctly, the 128-bit alignment requirement is only
> needed when using the explicit vectorization, and thus one would expect
> to find the assertion in question disabled when vectorization is -- but
> it is not.
>
> Are there any other reasons why this assertion is enabled even with
> vectorization disabled?
Even if vectorization is disabled, we still keep the 128 bit
alignment. This is so that vectorized and non-vectorized code are
ABI-compatible, i.e. can be linked with each other and successfully
run.
In the development branch, there is EIGEN_DONT_ALIGN which is what
you're really looking for (and breaks ABI compatibility). Of course,
EIGEN_DONT_ALIGN also disables vectorization.
In 2.0.5 you can either manually disable alignment by editing
EIGEN_ARCH_WANTS_ALIGNMENT, or you can use your idea:
> Is it safe to define
> EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT when EIGEN_DONT_VECTORIZE is
> defined?
Yes, it is safe. Since no SIMD instruction is then used, nothing bad
can happen in case of a non-128bit-aligned pointer.
We don't do it automatically because that leads to the curious
situation where code that runs fine without vectorization suddenly
crashes when enabling vectorization. But go ahead if that's what you
want :)
Benoit