# define MY_ALIGNED_MEMORY_ALIGN sizeof(__m256) /* _mm_malloc align [bytes] */ # define MY_ASSUME_ALIGNED(x) __assume_aligned((x),MY_ALIGNED_MEMORY_ALIGN) for(auto& i1:packets) { MY_ASSUME_ALIGNED(i1.left); MY_ASSUME_ALIGNED(i1.right); }
"packets" is std::vector<> of structure with "left" and "right" float pointers, suitable for vectorization.
Isn't this give an overhead for this "for" loop when I just only want to give compiler a hint that pointers are aligned?