Skip to content

Commit

Permalink
fix(gpu): fix memory error in cg classical PBS
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesLeroy committed Oct 31, 2024
1 parent 3611dec commit 8643b06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ __global__ void device_programmable_bootstrap_cg(

// We always compute the pointer with most restrictive alignment to avoid
// alignment issues
double2 *accumulator_fft = (double2 *)selected_memory;
Torus *accumulator =
(Torus *)accumulator_fft +
(ptrdiff_t)(sizeof(double2) * polynomial_size / 2 / sizeof(Torus));
Torus *accumulator = (Torus *)selected_memory;
Torus *accumulator_rotated =
(Torus *)accumulator + (ptrdiff_t)polynomial_size;
(Torus *)accumulator + (ptrdiff_t)(polynomial_size);
double2 *accumulator_fft =
(double2 *)(accumulator_rotated) +
(ptrdiff_t)(polynomial_size * sizeof(Torus) / sizeof(double2));

if constexpr (SMD == PARTIALSM)
accumulator_fft = (double2 *)sharedmem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ __global__ void __launch_bounds__(params::degree / params::opt)

// We always compute the pointer with most restrictive alignment to avoid
// alignment issues
double2 *accumulator_fft = (double2 *)selected_memory;
Torus *accumulator =
(Torus *)accumulator_fft +
(ptrdiff_t)(sizeof(double2) * params::degree / 2 / sizeof(Torus));
Torus *accumulator = (Torus *)selected_memory;
double2 *accumulator_fft =
(double2 *)accumulator +
(ptrdiff_t)(sizeof(Torus) * params::degree / sizeof(double2));

if constexpr (SMD == PARTIALSM)
accumulator_fft = (double2 *)sharedmem;
Expand Down

0 comments on commit 8643b06

Please sign in to comment.