Re: [eigen] No vectorization in presence of .cast<T>() calls |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] No vectorization in presence of .cast<T>() calls
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 22 Dec 2010 03:37:49 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uWQp7GCt0dt4Y4J+1QOO/tcAVgAxSJxQmDIcuEbAhbA=; b=Hc3l4S5shUkzF9GRnCqS+HmtMpCO+yNO7sIgvitbOyZLGOHal+zYbaYbt0BGoho6Qf oOvccoiU92Q0kDaJgkoQlRRZMLb8bJ3ddz6S1JXBgXhT1yBtzkspbWqRquSTsLqktPIK 2GWoohmTQoPGYfYZRBmRINLKJSehqcxgABzx0=
- 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=BgUUIDTGj3ZvjFto+gvoLiSyD0vbJAa/9K3g5/xX8Pidey3oeamQxPYjI41cvxnIhF vT06vqlL6hw6DgdTulEUaCSNTYI09OcTvs7LOtorJNquy+QSuvL60d4VH2UOdcese4MS tlYeQs9CX/X/pRvXF5gpD1k7G7hRFdF5yQCIs=
2010/12/19 Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>:
> On 18.12.2010 14:45, Benoit Jacob wrote:
>> 2010/12/18 Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>:
>>> [...]
>>> Another point: Did someone already think about how to support AVX in the
>>> future? -- Last time I checked there were some hard-coded 16 in the code ...
>>
>> Sure, as soon as AVX hardware is actually available, that's a useful
>> thing to do :-)
>>
>> Yes there still are hardcoded 16's but that's not a big problem.
>> Should be easy to get rid of, as they mostly don't affect the API.
>>
>> The only thing that worries me a little bit is when this impacts the
>> API itself. There are 2 such places:
>> - the Aligned option to Map
>> - the AlignedBit flag on expression (that one is largely internal though).
>>
>> What we can do in Eigen 3.1 is:
>> - replace Aligned by a template<int N=16> struct Aligned. So Aligned
>> would mean 16-byte aligned, and you could do Aligned<32> if you want
>> to explicitly specify 32 byte alignment. This preserves the API, but
>> changes the ABI of class Map, I think that's OK: we're only making ABI
>> stability guarantees on plain objects, not expressions, so especially
>> in Eigen 3.0 this doesn't have to include class Map.
>
> I'm afraid you would have to write Aligned<> then, so for full
> API-compatibility maybe a new struct and a typedef would be required.
OK, whatever: then let's have a typedef Aligned for Alignment_t<16>,
or let's have an *integer* Alignment parameter with Aligned being a
deprecated integer constant with value 16; we're not running short of
possibilities there.
>
> Also regarding ABI-stability: Having a struct like this:
> struct S{double d; Vector4d vec;};
> leads to different layout depending on alignment requirements (depending
> on alignment requirements of vec the struct is 40, 48 or 64 bytes long
> (though I don't know how far ABI stability goes for you).
Indeed, and we must not break ABI of plain matrix/array classes such
as Vector4d, that's one of the basic constraints to keep in mind here.
>
> On the other hand I don't know if 32byte alignment is required at all
> for AVX (wikipedia says: "The alignment requirement of SIMD memory
> operands is relaxed.").
It's not required but IIUC buys you better performance for certain instructions.
Benoit
> Also I agree that there is currently no reason
> for a rush to support AVX ...
>
> Christoph
>
> --
> ----------------------------------------------
> Dipl.-Inf. Christoph Hertzberg
> Cartesium 0.051
> Universität Bremen
> Enrique-Schmidt-Straße 5
> 28359 Bremen
>
> Tel: (+49) 421-218-64252
> ----------------------------------------------
>
>
>