|Re: [eigen] How do you link multiple versions (e.g. AVX vs SSE) of the same Eigen code?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Subject: Re: [eigen] How do you link multiple versions (e.g. AVX vs SSE) of the same Eigen code?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 28 Jan 2015 09:17:54 +0100
- Cc: eigen <eigen@xxxxxxxxxxxxxxxxxxx>, Benoit Steiner <benoit.steiner.goog@xxxxxxxxx>
- 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 :cc:content-type; bh=YpAiiFSpOh+T6rD35Nt6EJL2aiMo3TqWwPskmYv8eoE=; b=hjlf2GX+ckbxBPd86d75xpzVcVArt4xblVkJfBXKgRcj1T/juGMRtdKvON7hi8ffTf 7LK/l9vvKGKMUU7ODpjfwVpRC8YZMm2LbyQbj2/NWHSKgpIihWoRgQPmGXHk6vr5NaB4 f1ZiLWnUcwySgHTqTHSfPdNMKdHKMDmC/YRlFg5A/R8Dr7YjCPeEq0zPqwzug5hNWR4W aFEBjWoGo203kXnJBjV6xzX3qV0FBc85Ud3XGuBoAT7udWsn8iTbBh7K8I0lUCbIhHPQ tXOTgPmI06fysWnHKoOFXEM40dPdGWOJUJJ4zrAkIgGPeSJXJqa/ddADv1XBvLZ7UGp6 hrig==
Support for AVX is not completely finalized.. In particular we still have to re-enable vectorization for 128bits width vectors. So finally Vector4f will still be 16 bytes aligned and vectorized.
Then regarding alignment/ABI issues, I would keep the current behavior by default: if someone enable AVX, the best option is really to enable 32 bytes alignement, otherwise AVX gains would be strongly reduced. There are many other compiler options breaking the ABI anyway, so this only has to be clearly documented. For use cases as yours, we could offer compile-time options to choose the default maximal alignement requirement: 0, 16, 32, etc. instead of the current options that only allow you to disable alignement. Then it is up to the user to choose whether he prefers to enforce ABI compatibility by enabling 32B alignment on SSE or limit to 16B alignment for AVX.