Skip to content

Commit bccc919

Browse files
guillermo-oyarzunpdroalves
authored andcommitted
fix(gpu): fix wrong number of blocks used in cast
1 parent 5de1445 commit bccc919

File tree

1 file changed

+4
-5
lines changed
  • tfhe/src/integer/gpu/server_key/radix

1 file changed

+4
-5
lines changed

tfhe/src/integer/gpu/server_key/radix/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl CudaServerKey {
524524
let extended_ct_info = ct
525525
.as_ref()
526526
.info
527-
.after_extend_radix_with_trivial_zero_blocks_lsb(num_blocks);
527+
.after_extend_radix_with_trivial_zero_blocks_lsb(new_num_blocks);
528528
T::from(CudaRadixCiphertext::new(extended_ct_list, extended_ct_info))
529529
}
530530

@@ -608,7 +608,7 @@ impl CudaServerKey {
608608
let extended_ct_info = ct
609609
.as_ref()
610610
.info
611-
.after_extend_radix_with_trivial_zero_blocks_msb(num_blocks);
611+
.after_extend_radix_with_trivial_zero_blocks_msb(new_num_blocks);
612612
T::from(CudaRadixCiphertext::new(extended_ct_list, extended_ct_info))
613613
}
614614

@@ -692,7 +692,7 @@ impl CudaServerKey {
692692
ciphertext_modulus,
693693
);
694694

695-
let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_lsb(num_blocks);
695+
let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_lsb(new_num_blocks);
696696
T::from(CudaRadixCiphertext::new(trimmed_ct_list, trimmed_ct_info))
697697
}
698698

@@ -775,8 +775,7 @@ impl CudaServerKey {
775775
LweCiphertextCount(new_num_blocks),
776776
ciphertext_modulus,
777777
);
778-
779-
let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_msb(num_blocks);
778+
let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_msb(new_num_blocks);
780779
T::from(CudaRadixCiphertext::new(trimmed_ct_list, trimmed_ct_info))
781780
}
782781

0 commit comments

Comments
 (0)