chore: enable unused_imports lint in doctests

This commit is contained in:
Mayeul@Zama
2025-07-21 15:44:23 +02:00
committed by mayeul-zama
parent 63203c58aa
commit 09aaa4e045
31 changed files with 51 additions and 175 deletions

View File

@@ -32,7 +32,7 @@ use tfhe::shortint::parameters::{
};
use tfhe::{
set_server_key, CompressedCiphertextList, CompressedCiphertextListBuilder, FheBool,
FheInt64, FheUint16, FheUint2, FheUint32,
FheInt64, FheUint2, FheUint32,
};
fn main() {

View File

@@ -31,9 +31,7 @@ When selecting a specific GPU to execute on, there are two essential requirement
Instead of a single server key being used across all GPUs automatically, youll need decompress the server key to each GPU, so that the key is available in memory.
For example, by default, the GPU server key is decompressed and loaded onto all available GPUs automatically as follows:
```rust
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey};
use tfhe::prelude::*;
use rayon::prelude::*;
use tfhe::{ConfigBuilder, ClientKey, CompressedServerKey};
fn main() {
let config = ConfigBuilder::default().build();
@@ -47,9 +45,7 @@ fn main() {
However, to use the multi-GPU selection feature, you can create a vector of server keys, each on a specific GPU:
```rust
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey, GpuIndex};
use tfhe::prelude::*;
use rayon::prelude::*;
use tfhe::{ConfigBuilder, ClientKey, CompressedServerKey, GpuIndex};
use tfhe::core_crypto::gpu::get_number_of_gpus;
fn main() {
let config = ConfigBuilder::default().build();
@@ -66,9 +62,8 @@ fn main() {
#### Step 2: Define the inputs to operate on
We will be doing 100 additions in parallel on each GPU:
```rust
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey, FheUint64, GpuIndex};
use tfhe::{ConfigBuilder, ClientKey, CompressedServerKey, FheUint64, GpuIndex};
use tfhe::prelude::*;
use rayon::prelude::*;
use tfhe::core_crypto::gpu::get_number_of_gpus;
use rand::{thread_rng, Rng};
fn main() {

View File

@@ -35,7 +35,7 @@ The following example shows how to perform string operations:
```rust
use tfhe::prelude::*;
use tfhe::{
generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringLen,
generate_keys, set_server_key, ConfigBuilder, FheAsciiString,
};
fn main() -> Result<(), Box<dyn std::error::Error>> {

View File

@@ -12,10 +12,8 @@ use crate::core_crypto::prelude::*;
///
/// ```rust
/// use itertools::Itertools;
/// use tfhe_csprng::seeders::Seed;
/// use tfhe::core_crypto::fft_impl::common::modulus_switch;
/// use tfhe::core_crypto::prelude::*;
/// use tfhe::core_crypto::prelude::compressed_modulus_switched_lwe_ciphertext::CompressedModulusSwitchedLweCiphertext;
/// use tfhe_csprng::seeders::Seed;
///
/// let log_modulus = 12;
///
@@ -43,14 +41,15 @@ use crate::core_crypto::prelude::*;
/// &mut encryption_generator,
/// );
///
/// let lwe_msed_before = lwe_ciphertext_modulus_switch::<_, u64, _>(lwe, CiphertextModulusLog(log_modulus));
/// let lwe_msed_before =
/// lwe_ciphertext_modulus_switch::<_, u64, _>(lwe, CiphertextModulusLog(log_modulus));
///
/// // Can be stored using much less space than the standard lwe ciphertexts
/// let compressed = lwe_msed_before.compress::<u64>();
///
/// let lwe_msed_after = compressed.extract::<u64>();
///
/// for (i, j) in lwe_msed_before.mask().zip_eq(lwe_msed_after.mask()){
/// for (i, j) in lwe_msed_before.mask().zip_eq(lwe_msed_after.mask()) {
/// assert_eq!(i, j);
/// }
///

View File

@@ -6,10 +6,7 @@ use crate::GpuIndex;
/// ```rust
/// use rand::Rng;
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClientKey, CompressedServerKey, ConfigBuilder, FheInt16,
/// FheInt32, GpuIndex,
/// };
/// use tfhe::{set_server_key, ClientKey, CompressedServerKey, ConfigBuilder, FheInt32, GpuIndex};
///
/// let config = ConfigBuilder::default();
/// let client_key = ClientKey::generate(config);

View File

@@ -61,8 +61,7 @@ impl<Id: FheUintId> FheUint<Id> {
///
/// ```rust
/// use tfhe::core_crypto::gpu::check_valid_cuda_malloc_assert_oom;
/// use tfhe::prelude::FheDecrypt;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheUint8, GpuIndex, Seed};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheUint8, GpuIndex};
///
/// let config = ConfigBuilder::default().build();
/// let (client_key, server_key) = generate_keys(config);
@@ -147,8 +146,7 @@ impl<Id: FheUintId> FheUint<Id> {
///
/// ```rust
/// use tfhe::core_crypto::gpu::check_valid_cuda_malloc_assert_oom;
/// use tfhe::prelude::FheDecrypt;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheUint8, GpuIndex, Seed};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheUint8, GpuIndex};
///
/// let config = ConfigBuilder::default().build();
/// let (client_key, server_key) = generate_keys(config);
@@ -236,8 +234,7 @@ impl<Id: FheIntId> FheInt<Id> {
///
/// ```rust
/// use tfhe::core_crypto::gpu::check_valid_cuda_malloc_assert_oom;
/// use tfhe::prelude::FheDecrypt;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheInt8, GpuIndex, Seed};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheInt8, GpuIndex};
///
/// let config = ConfigBuilder::default().build();
/// let (client_key, server_key) = generate_keys(config);
@@ -323,8 +320,7 @@ impl<Id: FheIntId> FheInt<Id> {
///
/// ```rust
/// use tfhe::core_crypto::gpu::check_valid_cuda_malloc_assert_oom;
/// use tfhe::prelude::FheDecrypt;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheInt8, GpuIndex, Seed};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheInt8, GpuIndex};
///
/// let config = ConfigBuilder::default().build();
/// let (client_key, server_key) = generate_keys(config);

View File

@@ -498,7 +498,7 @@ where
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheBool, FheInt16};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheInt16};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -539,7 +539,7 @@ where
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheBool, FheInt16};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheInt16};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -711,7 +711,7 @@ where
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheBool, FheUint16};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheUint16};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -765,7 +765,7 @@ where
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheBool, FheUint16};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheUint16};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -238,10 +238,7 @@ impl FheEqIgnoreCase for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -281,10 +278,7 @@ impl FheEqIgnoreCase<ClearString> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -14,10 +14,7 @@ impl FheStringMatching<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -55,10 +52,7 @@ impl FheStringMatching<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -96,10 +90,7 @@ impl FheStringMatching<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -15,10 +15,7 @@ impl FheStringFind<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -62,10 +59,7 @@ impl FheStringFind<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -111,10 +105,7 @@ impl FheStringFind<&ClearString> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -156,10 +147,7 @@ impl FheStringFind<&ClearString> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -177,10 +177,7 @@ impl FheAsciiString {
/// ```
/// use tfhe::prelude::*;
/// use tfhe::safe_serialization::safe_serialize;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringLen};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -244,12 +241,7 @@ impl FheAsciiString {
/// # Example
///
/// ```
/// use tfhe::prelude::*;
/// use tfhe::safe_serialization::safe_serialize;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -277,12 +269,7 @@ impl FheAsciiString {
/// # Example
///
/// ```
/// use tfhe::prelude::*;
/// use tfhe::safe_serialization::safe_serialize;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -167,7 +167,7 @@ impl FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -201,7 +201,7 @@ impl FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty};
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -235,10 +235,7 @@ impl FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -298,10 +295,7 @@ impl FheStringRepeat<u16> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -342,10 +336,7 @@ impl FheStringRepeat<(FheUint16, u16)> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen, FheUint16,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheUint16};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -15,10 +15,7 @@ impl FheStringReplace<&Self> for FheAsciiString {
///
/// ```rust,no_run
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -61,10 +58,7 @@ impl FheStringReplace<&ClearString> for FheAsciiString {
///
/// ```rust,no_run
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -17,10 +17,7 @@ impl FheStringStrip<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -67,10 +64,7 @@ impl FheStringStrip<&Self> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -119,10 +113,7 @@ impl FheStringStrip<&ClearString> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -169,10 +160,7 @@ impl FheStringStrip<&ClearString> for FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString,
/// FheStringIsEmpty, FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ClearString, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -9,10 +9,7 @@ impl FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -45,10 +42,7 @@ impl FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);
@@ -81,10 +75,7 @@ impl FheAsciiString {
///
/// ```rust
/// use tfhe::prelude::*;
/// use tfhe::{
/// generate_keys, set_server_key, ConfigBuilder, FheAsciiString, FheStringIsEmpty,
/// FheStringLen,
/// };
/// use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheAsciiString};
///
/// let (client_key, server_key) = generate_keys(ConfigBuilder::default());
/// set_server_key(server_key);

View File

@@ -107,9 +107,7 @@ impl CudaBooleanBlock {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::integer::gpu::ciphertext::boolean_value::CudaBooleanBlock;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::BooleanBlock;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let gpu_index = 0;

View File

@@ -178,8 +178,6 @@ impl CudaCompressedCiphertextList {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::integer::{BooleanBlock, ClientKey, RadixCiphertext, SignedRadixCiphertext};
/// use tfhe::integer::ciphertext::CompressedCiphertextListBuilder;
/// use tfhe::integer::gpu::ciphertext::boolean_value::CudaBooleanBlock;
/// use tfhe::integer::gpu::ciphertext::compressed_ciphertext_list::CudaCompressedCiphertextListBuilder;
/// use tfhe::integer::gpu::ciphertext::{CudaSignedRadixCiphertext, CudaUnsignedRadixCiphertext};
@@ -324,7 +322,6 @@ impl CompressedCiphertextList {
/// use tfhe::integer::gpu::ciphertext::boolean_value::CudaBooleanBlock;
/// use tfhe::integer::gpu::ciphertext::{CudaSignedRadixCiphertext, CudaUnsignedRadixCiphertext};
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::ClientKey;
/// use tfhe::shortint::parameters::{
/// COMP_PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128,
/// PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128,

View File

@@ -199,7 +199,7 @@ impl CudaServerKey {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::CudaServerKey;
/// use tfhe::integer::{ClientKey, CompressedServerKey, ServerKey};
/// use tfhe::integer::{ClientKey, CompressedServerKey};
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let gpu_index = 0;

View File

@@ -703,7 +703,7 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::{CudaSignedRadixCiphertext, CudaUnsignedRadixCiphertext};
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///

View File

@@ -24,10 +24,8 @@ impl CudaServerKey {
/// # Example
///
/// ```rust
/// use std::ops::Not;
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -145,7 +143,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -406,7 +403,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -473,7 +469,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -540,7 +535,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -646,7 +640,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -751,7 +744,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -854,10 +846,8 @@ impl CudaServerKey {
/// # Example
///
/// ```rust
/// use std::ops::Not;
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;

View File

@@ -74,7 +74,6 @@ impl CudaServerKey {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let gpu_index = 0;
@@ -124,7 +123,6 @@ impl CudaServerKey {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let gpu_index = 0;
@@ -358,7 +356,7 @@ impl CudaServerKey {
///```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::{CudaRadixCiphertext, CudaUnsignedRadixCiphertext};
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::IntegerCiphertext;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -1524,7 +1522,7 @@ impl CudaServerKey {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::{gen_keys_radix, IntegerCiphertext};
/// use tfhe::integer::IntegerCiphertext;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let num_blocks = 8;

View File

@@ -382,7 +382,7 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::{CudaSignedRadixCiphertext, CudaUnsignedRadixCiphertext};
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///

View File

@@ -610,7 +610,6 @@ impl CudaServerKey {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let gpu_index = 0;
@@ -692,7 +691,6 @@ impl CudaServerKey {
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::integer::{gen_keys_radix, RadixCiphertext};
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///
/// let gpu_index = 0;

View File

@@ -33,7 +33,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -165,7 +164,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -342,7 +340,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -449,7 +446,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -619,7 +615,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -791,7 +786,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -906,7 +900,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;

View File

@@ -24,7 +24,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -194,7 +193,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;

View File

@@ -190,7 +190,7 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::{CudaSignedRadixCiphertext, CudaUnsignedRadixCiphertext};
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///

View File

@@ -27,7 +27,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -110,7 +109,6 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gen_keys_radix;
/// use tfhe::integer::gpu::ciphertext::CudaUnsignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
@@ -533,7 +531,7 @@ impl CudaServerKey {
/// ```rust
/// use tfhe::core_crypto::gpu::CudaStreams;
/// use tfhe::core_crypto::gpu::vec::GpuIndex;
/// use tfhe::integer::gpu::ciphertext::{CudaSignedRadixCiphertext, CudaUnsignedRadixCiphertext};
/// use tfhe::integer::gpu::ciphertext::CudaSignedRadixCiphertext;
/// use tfhe::integer::gpu::gen_keys_radix_gpu;
/// use tfhe::shortint::parameters::PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128;
///

View File

@@ -6,7 +6,6 @@
// https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#showing-warnings-in-doctests
#![doc(test(attr(warn(unused))))]
#![doc(test(attr(allow(unused_variables))))]
#![doc(test(attr(allow(unused_imports))))]
// Enable all warnings first as it may break the "allow" priority/activation as some lints gets
// moved around in clippy categories

View File

@@ -403,7 +403,6 @@ impl<AP: EncryptionAtomicPattern> GenericClientKey<AP> {
/// # Example
///
/// ```rust
/// use tfhe::core_crypto::algorithms::misc::divide_round;
/// use tfhe::shortint::gen_keys;
/// use tfhe::shortint::parameters::PARAM_MESSAGE_2_CARRY_2_KS_PBS;
///

View File

@@ -197,7 +197,6 @@ impl KeySwitchingKey {
/// V1_3_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128,
/// V1_3_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128,
/// };
/// use tfhe::shortint::prelude::*;
/// use tfhe::shortint::{gen_keys, KeySwitchingKey};
///
/// // Generate the client keys and server keys:
@@ -365,7 +364,6 @@ impl KeySwitchingKey {
/// V1_3_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128,
/// V1_3_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128,
/// };
/// use tfhe::shortint::prelude::*;
/// use tfhe::shortint::{gen_keys, KeySwitchingKey};
///
/// // Generate the client keys and server keys:
@@ -522,7 +520,6 @@ impl<'keys> KeySwitchingKeyView<'keys> {
/// V1_3_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128,
/// V1_3_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128,
/// };
/// use tfhe::shortint::prelude::*;
/// use tfhe::shortint::{gen_keys, KeySwitchingKey};
///
/// // Generate the client keys and server keys: