Summary: | doubles might be aligned on a 4 bytes boundary on win32 | ||
---|---|---|---|
Product: | Eigen | Reporter: | Gael Guennebaud <gael.guennebaud> |
Component: | Core - vectorization | Assignee: | Nobody <eigen.nobody> |
Status: | RESOLVED FIXED | ||
Severity: | Unknown | CC: | chtz, gael.guennebaud, jacob.benoit.1, markos |
Priority: | Normal | ||
Version: | 3.2 | ||
Hardware: | x86 - 32-bit | ||
OS: | Windows | ||
Whiteboard: |
Description
Gael Guennebaud
2015-04-24 15:08:54 UTC
I'm not sure if the following is worth the effort: Could/should we distinguish between buffers that are: a) 16 byte aligned b) sizeof(Scalar) aligned c) entirely unaligned b) would be the case for segments of vectors allocated by Eigen. And we could enforce b) for stack-allocated Eigen objects. For Maps we need to think about alignment anyways, wrt AVX support (Bug 973), and if we want to support 32/16 and unaligned Maps, also distinguishing between 8 and 4 byte alignment sounds logical. This might justify an independent template parameter, rather than additional flags, however that would break API-compatibility. Perhaps, we can reserve 2-4 bits of the Options to encode alignment, instead? Preferably in a way that the current values correspond to 16 byte and 4 byte alignment (or 16 byte and sizeof(Scalar)?). This issue is really annoying. As if the vectorization logic was not complicated enough! Perhaps the simplest would be to properly assert (in Map) and ask users to enforce scalar alignment by providing a cross platform EIGEN_ALIGN8 macro. (In reply to Gael Guennebaud from comment #2) > Perhaps the simplest would be to properly assert (in Map) and ask users to > enforce scalar alignment by providing a cross platform EIGEN_ALIGN8 macro. I implemented this as this is the least we can do for now: devel: https://bitbucket.org/eigen/eigen/commits/249d9c26b8cb/ 3.2: https://bitbucket.org/eigen/eigen/commits/c6e0b0bc70a5/ Finally, I realized that first_aligned already checked the scalar alignment of the given pointer at runtime, regardless of packet_traits<>::AlignedOnScalar, so to be consistent, we should do so in slice-vectorization and remove the previously introduced assert. devel: https://bitbucket.org/eigen/eigen/commits/a2d939a3bf63 3.2: https://bitbucket.org/eigen/eigen/commits/19d04038a0fc -- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1003. |