Skip to content

Commit

Permalink
chore(gpu): limit base log to 32 because of the monomial degree type
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesLeroy committed Oct 7, 2024
1 parent 7c7e344 commit f68c2e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ void cuda_programmable_bootstrap_lwe_ciphertext_vector_32(
uint32_t num_samples, uint32_t lut_count, uint32_t lut_stride) {

if (base_log > 32)
PANIC("Cuda error (classical PBS): base log should be > number of bits "
"in the ciphertext representation (32)");
PANIC("Cuda error (classical PBS): base log should be <= 32")

pbs_buffer<uint32_t, CLASSICAL> *buffer =
(pbs_buffer<uint32_t, CLASSICAL> *)mem_ptr;
Expand Down Expand Up @@ -650,9 +649,8 @@ void cuda_programmable_bootstrap_lwe_ciphertext_vector_64(
int8_t *mem_ptr, uint32_t lwe_dimension, uint32_t glwe_dimension,
uint32_t polynomial_size, uint32_t base_log, uint32_t level_count,
uint32_t num_samples, uint32_t lut_count, uint32_t lut_stride) {
if (base_log > 64)
PANIC("Cuda error (classical PBS): base log should be > number of bits "
"in the ciphertext representation (64)");
if (base_log > 32)
PANIC("Cuda error (classical PBS): base log should be <= 32")

pbs_buffer<uint64_t, CLASSICAL> *buffer =
(pbs_buffer<uint64_t, CLASSICAL> *)mem_ptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ void cuda_cg_multi_bit_programmable_bootstrap_lwe_ciphertext_vector(
uint32_t base_log, uint32_t level_count, uint32_t num_samples,
uint32_t lut_count, uint32_t lut_stride) {

if (base_log > 64)
PANIC("Cuda error (multi-bit PBS): base log should be > number of bits in "
"the ciphertext representation (64)");
if (base_log > 32)
PANIC("Cuda error (multi-bit PBS): base log should be <= 32")

switch (polynomial_size) {
case 256:
Expand Down Expand Up @@ -146,9 +145,8 @@ void cuda_multi_bit_programmable_bootstrap_lwe_ciphertext_vector(
uint32_t base_log, uint32_t level_count, uint32_t num_samples,
uint32_t lut_count, uint32_t lut_stride) {

if (base_log > 64)
PANIC("Cuda error (multi-bit PBS): base log should be > number of bits in "
"the ciphertext representation (64)");
if (base_log > 32)
PANIC("Cuda error (multi-bit PBS): base log should be <= 32")

switch (polynomial_size) {
case 256:
Expand Down Expand Up @@ -591,9 +589,8 @@ void cuda_tbc_multi_bit_programmable_bootstrap_lwe_ciphertext_vector(
uint32_t base_log, uint32_t level_count, uint32_t num_samples,
uint32_t lut_count, uint32_t lut_stride) {

if (base_log > 64)
PANIC("Cuda error (multi-bit PBS): base log should be > number of bits in "
"the ciphertext representation (64)");
if (base_log > 32)
PANIC("Cuda error (multi-bit PBS): base log should be <= 32")

switch (polynomial_size) {
case 256:
Expand Down

0 comments on commit f68c2e7

Please sign in to comment.