Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a47f6af

Browse files
committedApr 21, 2025·
add alignas
1 parent dc87cf5 commit a47f6af

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
 

‎cp-algo/math/cvector.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ namespace cp_algo::math::fft {
5555
auto [Bvx, Bvy] = B.vget(k);
5656
auto [Brvx, Brvy] = vpoint(Bvx, Bvy) * vpoint(real(rt), imag(rt));
5757
auto [Ax, Ay] = A.vget(k);
58-
ftype Bx[2 * flen], By[2 * flen];
58+
alignas(32) ftype Bx[2 * flen];
59+
alignas(32) ftype By[2 * flen];
5960
Bvx.copy_to(Bx + flen, std::experimental::vector_aligned);
6061
Bvy.copy_to(By + flen, std::experimental::vector_aligned);
6162
Brvx.copy_to(Bx, std::experimental::vector_aligned);

‎cp-algo/math/fft.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ namespace cp_algo::math::fft {
4646
auto [Dvx, Dvy] = D.vget(k);
4747
auto [Crvx, Crvy] = vpoint(Cvx, Cvy) * vpoint(real(rt), imag(rt));
4848
auto [Drvx, Drvy] = vpoint(Dvx, Dvy) * vpoint(real(rt), imag(rt));
49-
ftype Cx[2 * flen], Cy[2 * flen];
50-
ftype Dx[2 * flen], Dy[2 * flen];
49+
alignas(32) ftype Cx[2 * flen];
50+
alignas(32) ftype Cy[2 * flen];
51+
alignas(32) ftype Dx[2 * flen];
52+
alignas(32) ftype Dy[2 * flen];
5153
Cvx.copy_to(Cx + flen, std::experimental::vector_aligned);
5254
Cvy.copy_to(Cy + flen, std::experimental::vector_aligned);
5355
Dvx.copy_to(Dx + flen, std::experimental::vector_aligned);

0 commit comments

Comments
 (0)
Please sign in to comment.