Skip to content

Commit

Permalink
chore(gpu): add checks in hillis&steele to avoid wrong memory access
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesLeroy committed Jul 24, 2024
1 parent 91f05b0 commit 141eb79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backends/tfhe-cuda-backend/cuda/src/integer/integer.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ void host_propagate_single_carry(cudaStream_t *streams, uint32_t *gpu_indexes,
gpu_indexes[0]);

for (int step = 0; step < num_steps; step++) {
if (space > num_blocks - 1)
PANIC("Cuda error: step output is going out of bounds in Hillis Steele "
"propagation")
auto cur_blocks = &step_output[space * big_lwe_size];
auto prev_blocks = generates_or_propagates;
int cur_total_blocks = num_blocks - space;
Expand Down Expand Up @@ -615,6 +618,9 @@ void host_propagate_single_sub_borrow(cudaStream_t *streams,
gpu_indexes[0]);

for (int step = 0; step < num_steps; step++) {
if (space > num_blocks - 1)
PANIC("Cuda error: step output is going out of bounds in Hillis Steele "
"propagation")
auto cur_blocks = &step_output[space * big_lwe_size];
auto prev_blocks = generates_or_propagates;
int cur_total_blocks = num_blocks - space;
Expand Down

0 comments on commit 141eb79

Please sign in to comment.