Skip to content

Commit

Permalink
fix(gpu): fix gpu index initialization in doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesLeroy committed Feb 11, 2025
1 parent 00037f3 commit af838e2
Show file tree
Hide file tree
Showing 24 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion tfhe/src/integer/gpu/ciphertext/boolean_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl CudaBooleanBlock {
/// use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64;
///
/// let gpu_index = 0;
/// let mut stream = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut stream = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 1;
Expand Down
10 changes: 5 additions & 5 deletions tfhe/src/integer/gpu/ciphertext/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl CudaUnsignedRadixCiphertext {
/// let size = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_radix_gpu(
Expand Down Expand Up @@ -256,7 +256,7 @@ impl CudaUnsignedRadixCiphertext {
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down Expand Up @@ -300,7 +300,7 @@ impl CudaSignedRadixCiphertext {
/// let size = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_radix_gpu(
Expand Down Expand Up @@ -371,7 +371,7 @@ impl CudaSignedRadixCiphertext {
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down Expand Up @@ -408,7 +408,7 @@ impl CudaRadixCiphertext {
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/integer/gpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ where
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
/// // generate the client key and the server key:
/// let num_blocks = 4;
/// let (cks, sks) = gen_keys_radix_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, num_blocks, &mut streams);
Expand Down
4 changes: 2 additions & 2 deletions tfhe/src/integer/gpu/server_key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key:
/// let cks = ClientKey::new(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64);
Expand Down Expand Up @@ -171,7 +171,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
/// let size = 4;
/// let cks = ClientKey::new(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64);
/// let compressed_sks = CompressedServerKey::new_radix_compressed_server_key(&cks);
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/integer/gpu/server_key/radix/abs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down
8 changes: 4 additions & 4 deletions tfhe/src/integer/gpu/server_key/radix/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down Expand Up @@ -139,7 +139,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down Expand Up @@ -421,7 +421,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down Expand Up @@ -607,7 +607,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let num_blocks = 4;
Expand Down
16 changes: 8 additions & 8 deletions tfhe/src/integer/gpu/server_key/radix/bitwise_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -124,7 +124,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -271,7 +271,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -338,7 +338,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -405,7 +405,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -511,7 +511,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -616,7 +616,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down Expand Up @@ -722,7 +722,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // We have 4 * 2 = 8 bits of message
/// let size = 4;
Expand Down
16 changes: 8 additions & 8 deletions tfhe/src/integer/gpu/server_key/radix/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -223,7 +223,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -322,7 +322,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -416,7 +416,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -480,7 +480,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -604,7 +604,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -728,7 +728,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down Expand Up @@ -852,7 +852,7 @@ impl CudaServerKey {
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// let size = 4;
/// // Generate the client key and the server key:
Expand Down
12 changes: 6 additions & 6 deletions tfhe/src/integer/gpu/server_key/radix/ilog2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ impl CudaServerKey {
/// let number_of_blocks = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, &streams);
Expand Down Expand Up @@ -593,7 +593,7 @@ impl CudaServerKey {
/// let number_of_blocks = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, &streams);
Expand Down Expand Up @@ -666,7 +666,7 @@ impl CudaServerKey {
/// let number_of_blocks = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, &streams);
Expand Down Expand Up @@ -739,7 +739,7 @@ impl CudaServerKey {
/// let number_of_blocks = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, &streams);
Expand Down Expand Up @@ -805,7 +805,7 @@ impl CudaServerKey {
/// let number_of_blocks = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, &streams);
Expand Down Expand Up @@ -875,7 +875,7 @@ impl CudaServerKey {
/// let number_of_blocks = 4;
///
/// let gpu_index = 0;
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex(gpu_index));
/// let mut streams = CudaStreams::new_single_gpu(GpuIndex::new(gpu_index));
///
/// // Generate the client key and the server key:
/// let (cks, sks) = gen_keys_gpu(PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64, &streams);
Expand Down
Loading

0 comments on commit af838e2

Please sign in to comment.