How do I align cv::Mat for AVX-512/AVX2 architectures?
问题 Disclamer: I'm a simd newbie, so if this filthy peasant asks some bad questions. From my understanding, AVX-512 architectures can process up to 16 float variables all together, while AVX2 "only" 4. In order to take advantage of this, the data has to be aligned. As I found out here, this can be done with: For AVX-512: alignas(32) float a[8]; For AVX2: alignas(16) float a[8]; Ok, so my first question is: since 16 is a factor of 32, why don't we always use alignas(32) also for AVX2 architectures