/* automatically generated by rust-bindgen 0.71.1 */

use crate::ffi;

unsafe extern "C" {
    pub fn cuda_convert_lwe_ciphertext_vector_to_gpu_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        number_of_cts: u32,
        lwe_dimension: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_convert_lwe_ciphertext_vector_to_cpu_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        number_of_cts: u32,
        lwe_dimension: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_glwe_sample_extract_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        glwe_array_in: *const ffi::c_void,
        nth_array: *const u32,
        num_nths: u32,
        lwe_per_glwe: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_modulus_switch_inplace_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        size: u32,
        log_modulus: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_modulus_switch_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_out: *mut ffi::c_void,
        lwe_in: *const ffi::c_void,
        size: u32,
        log_modulus: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_centered_modulus_switch_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_out: *mut ffi::c_void,
        lwe_in: *const ffi::c_void,
        lwe_dimension: u32,
        log_modulus: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_improve_noise_modulus_switch_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_array_indexes: *const ffi::c_void,
        encrypted_zeros: *const ffi::c_void,
        lwe_size: u32,
        num_lwes: u32,
        num_zeros: u32,
        input_variance: f64,
        r_sigma: f64,
        bound: f64,
        log_modulus: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_glwe_sample_extract_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        glwe_array_in: *const ffi::c_void,
        nth_array: *const u32,
        num_nths: u32,
        lwe_per_glwe: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
    );
}
pub const PBS_TYPE_MULTI_BIT: PBS_TYPE = 0;
pub const PBS_TYPE_CLASSICAL: PBS_TYPE = 1;
pub type PBS_TYPE = ffi::c_uint;
pub const PBS_MS_REDUCTION_T_NO_REDUCTION: PBS_MS_REDUCTION_T = 0;
pub const PBS_MS_REDUCTION_T_CENTERED: PBS_MS_REDUCTION_T = 1;
pub type PBS_MS_REDUCTION_T = ffi::c_uint;
pub const SHIFT_OR_ROTATE_TYPE_LEFT_SHIFT: SHIFT_OR_ROTATE_TYPE = 0;
pub const SHIFT_OR_ROTATE_TYPE_RIGHT_SHIFT: SHIFT_OR_ROTATE_TYPE = 1;
pub const SHIFT_OR_ROTATE_TYPE_LEFT_ROTATE: SHIFT_OR_ROTATE_TYPE = 2;
pub const SHIFT_OR_ROTATE_TYPE_RIGHT_ROTATE: SHIFT_OR_ROTATE_TYPE = 3;
pub type SHIFT_OR_ROTATE_TYPE = ffi::c_uint;
pub const BITOP_TYPE_BITAND: BITOP_TYPE = 0;
pub const BITOP_TYPE_BITOR: BITOP_TYPE = 1;
pub const BITOP_TYPE_BITXOR: BITOP_TYPE = 2;
pub const BITOP_TYPE_SCALAR_BITAND: BITOP_TYPE = 3;
pub const BITOP_TYPE_SCALAR_BITOR: BITOP_TYPE = 4;
pub const BITOP_TYPE_SCALAR_BITXOR: BITOP_TYPE = 5;
pub type BITOP_TYPE = ffi::c_uint;
pub const COMPARISON_TYPE_EQ: COMPARISON_TYPE = 0;
pub const COMPARISON_TYPE_NE: COMPARISON_TYPE = 1;
pub const COMPARISON_TYPE_GT: COMPARISON_TYPE = 2;
pub const COMPARISON_TYPE_GE: COMPARISON_TYPE = 3;
pub const COMPARISON_TYPE_LT: COMPARISON_TYPE = 4;
pub const COMPARISON_TYPE_LE: COMPARISON_TYPE = 5;
pub const COMPARISON_TYPE_MAX: COMPARISON_TYPE = 6;
pub const COMPARISON_TYPE_MIN: COMPARISON_TYPE = 7;
pub type COMPARISON_TYPE = ffi::c_uint;
pub const Direction_Trailing: Direction = 0;
pub const Direction_Leading: Direction = 1;
pub type Direction = ffi::c_uint;
pub const BitValue_Zero: BitValue = 0;
pub const BitValue_One: BitValue = 1;
pub type BitValue = ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CudaStreamsFFI {
    pub streams: *const *mut ffi::c_void,
    pub gpu_indexes: *const u32,
    pub gpu_count: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of CudaStreamsFFI"][::std::mem::size_of::<CudaStreamsFFI>() - 24usize];
    ["Alignment of CudaStreamsFFI"][::std::mem::align_of::<CudaStreamsFFI>() - 8usize];
    ["Offset of field: CudaStreamsFFI::streams"]
        [::std::mem::offset_of!(CudaStreamsFFI, streams) - 0usize];
    ["Offset of field: CudaStreamsFFI::gpu_indexes"]
        [::std::mem::offset_of!(CudaStreamsFFI, gpu_indexes) - 8usize];
    ["Offset of field: CudaStreamsFFI::gpu_count"]
        [::std::mem::offset_of!(CudaStreamsFFI, gpu_count) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CudaRadixCiphertextFFI {
    pub ptr: *mut ffi::c_void,
    pub degrees: *mut u64,
    pub noise_levels: *mut u64,
    pub num_radix_blocks: u32,
    pub max_num_radix_blocks: u32,
    pub lwe_dimension: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of CudaRadixCiphertextFFI"][::std::mem::size_of::<CudaRadixCiphertextFFI>() - 40usize];
    ["Alignment of CudaRadixCiphertextFFI"]
        [::std::mem::align_of::<CudaRadixCiphertextFFI>() - 8usize];
    ["Offset of field: CudaRadixCiphertextFFI::ptr"]
        [::std::mem::offset_of!(CudaRadixCiphertextFFI, ptr) - 0usize];
    ["Offset of field: CudaRadixCiphertextFFI::degrees"]
        [::std::mem::offset_of!(CudaRadixCiphertextFFI, degrees) - 8usize];
    ["Offset of field: CudaRadixCiphertextFFI::noise_levels"]
        [::std::mem::offset_of!(CudaRadixCiphertextFFI, noise_levels) - 16usize];
    ["Offset of field: CudaRadixCiphertextFFI::num_radix_blocks"]
        [::std::mem::offset_of!(CudaRadixCiphertextFFI, num_radix_blocks) - 24usize];
    ["Offset of field: CudaRadixCiphertextFFI::max_num_radix_blocks"]
        [::std::mem::offset_of!(CudaRadixCiphertextFFI, max_num_radix_blocks) - 28usize];
    ["Offset of field: CudaRadixCiphertextFFI::lwe_dimension"]
        [::std::mem::offset_of!(CudaRadixCiphertextFFI, lwe_dimension) - 32usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CudaScalarDivisorFFI {
    pub chosen_multiplier_has_at_least_one_set: *const u64,
    pub decomposed_chosen_multiplier: *const u64,
    pub num_scalars: u32,
    pub active_bits: u32,
    pub shift_pre: u64,
    pub shift_post: u32,
    pub ilog2_chosen_multiplier: u32,
    pub chosen_multiplier_num_bits: u32,
    pub is_chosen_multiplier_zero: bool,
    pub is_abs_chosen_multiplier_one: bool,
    pub is_chosen_multiplier_negative: bool,
    pub is_chosen_multiplier_pow2: bool,
    pub chosen_multiplier_has_more_bits_than_numerator: bool,
    pub is_chosen_multiplier_geq_two_pow_numerator: bool,
    pub ilog2_divisor: u32,
    pub is_divisor_zero: bool,
    pub is_abs_divisor_one: bool,
    pub is_divisor_negative: bool,
    pub is_divisor_pow2: bool,
    pub divisor_has_more_bits_than_numerator: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of CudaScalarDivisorFFI"][::std::mem::size_of::<CudaScalarDivisorFFI>() - 64usize];
    ["Alignment of CudaScalarDivisorFFI"][::std::mem::align_of::<CudaScalarDivisorFFI>() - 8usize];
    ["Offset of field: CudaScalarDivisorFFI::chosen_multiplier_has_at_least_one_set"][::std::mem::offset_of!(
        CudaScalarDivisorFFI,
        chosen_multiplier_has_at_least_one_set
    ) - 0usize];
    ["Offset of field: CudaScalarDivisorFFI::decomposed_chosen_multiplier"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, decomposed_chosen_multiplier) - 8usize];
    ["Offset of field: CudaScalarDivisorFFI::num_scalars"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, num_scalars) - 16usize];
    ["Offset of field: CudaScalarDivisorFFI::active_bits"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, active_bits) - 20usize];
    ["Offset of field: CudaScalarDivisorFFI::shift_pre"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, shift_pre) - 24usize];
    ["Offset of field: CudaScalarDivisorFFI::shift_post"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, shift_post) - 32usize];
    ["Offset of field: CudaScalarDivisorFFI::ilog2_chosen_multiplier"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, ilog2_chosen_multiplier) - 36usize];
    ["Offset of field: CudaScalarDivisorFFI::chosen_multiplier_num_bits"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, chosen_multiplier_num_bits) - 40usize];
    ["Offset of field: CudaScalarDivisorFFI::is_chosen_multiplier_zero"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_chosen_multiplier_zero) - 44usize];
    ["Offset of field: CudaScalarDivisorFFI::is_abs_chosen_multiplier_one"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_abs_chosen_multiplier_one) - 45usize];
    ["Offset of field: CudaScalarDivisorFFI::is_chosen_multiplier_negative"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_chosen_multiplier_negative) - 46usize];
    ["Offset of field: CudaScalarDivisorFFI::is_chosen_multiplier_pow2"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_chosen_multiplier_pow2) - 47usize];
    ["Offset of field: CudaScalarDivisorFFI::chosen_multiplier_has_more_bits_than_numerator"][::std::mem::offset_of!(
        CudaScalarDivisorFFI,
        chosen_multiplier_has_more_bits_than_numerator
    )
        - 48usize];
    ["Offset of field: CudaScalarDivisorFFI::is_chosen_multiplier_geq_two_pow_numerator"][::std::mem::offset_of!(
        CudaScalarDivisorFFI,
        is_chosen_multiplier_geq_two_pow_numerator
    )
        - 49usize];
    ["Offset of field: CudaScalarDivisorFFI::ilog2_divisor"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, ilog2_divisor) - 52usize];
    ["Offset of field: CudaScalarDivisorFFI::is_divisor_zero"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_divisor_zero) - 56usize];
    ["Offset of field: CudaScalarDivisorFFI::is_abs_divisor_one"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_abs_divisor_one) - 57usize];
    ["Offset of field: CudaScalarDivisorFFI::is_divisor_negative"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_divisor_negative) - 58usize];
    ["Offset of field: CudaScalarDivisorFFI::is_divisor_pow2"]
        [::std::mem::offset_of!(CudaScalarDivisorFFI, is_divisor_pow2) - 59usize];
    ["Offset of field: CudaScalarDivisorFFI::divisor_has_more_bits_than_numerator"][::std::mem::offset_of!(
        CudaScalarDivisorFFI,
        divisor_has_more_bits_than_numerator
    ) - 60usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CudaLweCiphertextListFFI {
    pub ptr: *mut ffi::c_void,
    pub num_radix_blocks: u32,
    pub lwe_dimension: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of CudaLweCiphertextListFFI"]
        [::std::mem::size_of::<CudaLweCiphertextListFFI>() - 16usize];
    ["Alignment of CudaLweCiphertextListFFI"]
        [::std::mem::align_of::<CudaLweCiphertextListFFI>() - 8usize];
    ["Offset of field: CudaLweCiphertextListFFI::ptr"]
        [::std::mem::offset_of!(CudaLweCiphertextListFFI, ptr) - 0usize];
    ["Offset of field: CudaLweCiphertextListFFI::num_radix_blocks"]
        [::std::mem::offset_of!(CudaLweCiphertextListFFI, num_radix_blocks) - 8usize];
    ["Offset of field: CudaLweCiphertextListFFI::lwe_dimension"]
        [::std::mem::offset_of!(CudaLweCiphertextListFFI, lwe_dimension) - 12usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CudaPackedGlweCiphertextListFFI {
    pub ptr: *mut ffi::c_void,
    pub storage_log_modulus: u32,
    pub lwe_per_glwe: u32,
    pub total_lwe_bodies_count: u32,
    pub glwe_dimension: u32,
    pub polynomial_size: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of CudaPackedGlweCiphertextListFFI"]
        [::std::mem::size_of::<CudaPackedGlweCiphertextListFFI>() - 32usize];
    ["Alignment of CudaPackedGlweCiphertextListFFI"]
        [::std::mem::align_of::<CudaPackedGlweCiphertextListFFI>() - 8usize];
    ["Offset of field: CudaPackedGlweCiphertextListFFI::ptr"]
        [::std::mem::offset_of!(CudaPackedGlweCiphertextListFFI, ptr) - 0usize];
    ["Offset of field: CudaPackedGlweCiphertextListFFI::storage_log_modulus"]
        [::std::mem::offset_of!(CudaPackedGlweCiphertextListFFI, storage_log_modulus) - 8usize];
    ["Offset of field: CudaPackedGlweCiphertextListFFI::lwe_per_glwe"]
        [::std::mem::offset_of!(CudaPackedGlweCiphertextListFFI, lwe_per_glwe) - 12usize];
    ["Offset of field: CudaPackedGlweCiphertextListFFI::total_lwe_bodies_count"]
        [::std::mem::offset_of!(CudaPackedGlweCiphertextListFFI, total_lwe_bodies_count) - 16usize];
    ["Offset of field: CudaPackedGlweCiphertextListFFI::glwe_dimension"]
        [::std::mem::offset_of!(CudaPackedGlweCiphertextListFFI, glwe_dimension) - 20usize];
    ["Offset of field: CudaPackedGlweCiphertextListFFI::polynomial_size"]
        [::std::mem::offset_of!(CudaPackedGlweCiphertextListFFI, polynomial_size) - 24usize];
};
unsafe extern "C" {
    pub fn scratch_cuda_apply_univariate_lut_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        input_lut: *const ffi::c_void,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        input_lwe_ciphertext_count: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        lut_degree: u64,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_apply_many_univariate_lut_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        input_lut: *const ffi::c_void,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        num_many_lut: u32,
        lut_degree: u64,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_apply_univariate_lut_64(
        streams: CudaStreamsFFI,
        output_radix_lwe: *mut CudaRadixCiphertextFFI,
        input_radix_lwe: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        ksks: *const *mut ffi::c_void,
        bsks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_apply_univariate_lut_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_apply_bivariate_lut_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        input_lut: *const ffi::c_void,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        input_lwe_ciphertext_count: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        lut_degree: u64,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_apply_bivariate_lut_64(
        streams: CudaStreamsFFI,
        output_radix_lwe: *mut CudaRadixCiphertextFFI,
        input_radix_lwe_1: *const CudaRadixCiphertextFFI,
        input_radix_lwe_2: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        ksks: *const *mut ffi::c_void,
        bsks: *const *mut ffi::c_void,
        num_radix_blocks: u32,
        shift: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_apply_bivariate_lut_64(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn cuda_apply_many_univariate_lut_64(
        streams: CudaStreamsFFI,
        output_radix_lwe: *mut CudaRadixCiphertextFFI,
        input_radix_lwe: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        ksks: *const *mut ffi::c_void,
        bsks: *const *mut ffi::c_void,
        num_luts: u32,
        lut_stride: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_full_propagation_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_full_propagation_64_inplace(
        streams: CudaStreamsFFI,
        input_blocks: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        ksks: *const *mut ffi::c_void,
        bsks: *const *mut ffi::c_void,
        num_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_full_propagation(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_mult_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        is_boolean_left: bool,
        is_boolean_right: bool,
        message_modulus: u32,
        carry_modulus: u32,
        glwe_dimension: u32,
        lwe_dimension: u32,
        polynomial_size: u32,
        pbs_base_log: u32,
        pbs_level: u32,
        ks_base_log: u32,
        ks_level: u32,
        grouping_factor: u32,
        num_blocks: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_mult_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        radix_lwe_out: *mut CudaRadixCiphertextFFI,
        radix_lwe_left: *const CudaRadixCiphertextFFI,
        is_bool_left: bool,
        radix_lwe_right: *const CudaRadixCiphertextFFI,
        is_bool_right: bool,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        mem_ptr: *mut i8,
        polynomial_size: u32,
        num_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_mult(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn cuda_negate_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_in: *const CudaRadixCiphertextFFI,
        message_modulus: u32,
        carry_modulus: u32,
        num_radix_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_scalar_addition_ciphertext_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        scalar_input: *const ffi::c_void,
        h_scalar_input: *const ffi::c_void,
        num_scalars: u32,
        message_modulus: u32,
        carry_modulus: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_logical_scalar_shift_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        shift_type: SHIFT_OR_ROTATE_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_logical_scalar_shift_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        shift: u32,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_arithmetic_scalar_shift_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        shift_type: SHIFT_OR_ROTATE_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_arithmetic_scalar_shift_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        shift: u32,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_logical_scalar_shift(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn cleanup_cuda_arithmetic_scalar_shift(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_shift_and_rotate_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        shift_type: SHIFT_OR_ROTATE_TYPE,
        is_signed: bool,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_shift_and_rotate_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        lwe_shift: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_shift_and_rotate(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_comparison_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        lwe_ciphertext_count: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        op_type: COMPARISON_TYPE,
        is_signed: bool,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_comparison_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_1: *const CudaRadixCiphertextFFI,
        lwe_array_2: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cuda_scalar_comparison_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_in: *const CudaRadixCiphertextFFI,
        scalar_blocks: *const ffi::c_void,
        h_scalar_blocks: *const ffi::c_void,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        num_scalar_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_comparison(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_bitop_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        lwe_ciphertext_count: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        op_type: BITOP_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_bitop_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_1: *const CudaRadixCiphertextFFI,
        lwe_array_2: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cuda_scalar_bitop_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_input: *const CudaRadixCiphertextFFI,
        clear_blocks: *const ffi::c_void,
        h_clear_blocks: *const ffi::c_void,
        num_clear_blocks: u32,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_bitop(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_cmux_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        lwe_ciphertext_count: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_cmux_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_condition: *const CudaRadixCiphertextFFI,
        lwe_array_true: *const CudaRadixCiphertextFFI,
        lwe_array_false: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_cmux(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_scalar_rotate_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        shift_type: SHIFT_OR_ROTATE_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_scalar_rotate_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        n: u32,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_scalar_rotate(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_propagate_single_carry_64_inplace(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        requested_flag: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_add_and_propagate_single_carry_64_inplace(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        requested_flag: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_propagate_single_carry_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        carry_out: *mut CudaRadixCiphertextFFI,
        carry_in: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        requested_flag: u32,
        uses_carry: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_add_and_propagate_single_carry_64_inplace(
        streams: CudaStreamsFFI,
        lhs_array: *mut CudaRadixCiphertextFFI,
        rhs_array: *const CudaRadixCiphertextFFI,
        carry_out: *mut CudaRadixCiphertextFFI,
        carry_in: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        requested_flag: u32,
        uses_carry: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_propagate_single_carry(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn cleanup_cuda_add_and_propagate_single_carry(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_overflowing_sub_64_inplace(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        compute_overflow: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_overflowing_sub_64_inplace(
        streams: CudaStreamsFFI,
        lhs_array: *mut CudaRadixCiphertextFFI,
        rhs_array: *const CudaRadixCiphertextFFI,
        overflow_block: *mut CudaRadixCiphertextFFI,
        input_borrow: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        compute_overflow: u32,
        uses_input_borrow: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_overflowing_sub(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_partial_sum_ciphertexts_vec_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks_in_radix: u32,
        max_num_radix_in_vec: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        reduce_degrees_for_single_carry_propagation: bool,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_partial_sum_ciphertexts_vec_64(
        streams: CudaStreamsFFI,
        radix_lwe_out: *mut CudaRadixCiphertextFFI,
        radix_lwe_vec: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_partial_sum_ciphertexts_vec(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_scalar_mul_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        num_scalar_bits: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_scalar_multiplication_ciphertext_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
        decomposed_scalar: *const u64,
        has_at_least_one_set: *const u64,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        polynomial_size: u32,
        message_modulus: u32,
        num_scalars: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_scalar_mul(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_div_rem_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        is_signed: bool,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_div_rem_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        quotient: *mut CudaRadixCiphertextFFI,
        remainder: *mut CudaRadixCiphertextFFI,
        numerator: *const CudaRadixCiphertextFFI,
        divisor: *const CudaRadixCiphertextFFI,
        is_signed: bool,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_div_rem(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_compute_prefix_sum_hillis_steele_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        input_lut: *const ffi::c_void,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        lut_degree: u64,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_compute_prefix_sum_hillis_steele_64(
        streams: CudaStreamsFFI,
        output_radix_lwe: *mut CudaRadixCiphertextFFI,
        generates_or_propagates: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        ksks: *const *mut ffi::c_void,
        bsks: *const *mut ffi::c_void,
        num_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_compute_prefix_sum_hillis_steele_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cuda_integer_reverse_blocks_64_inplace(
        streams: CudaStreamsFFI,
        lwe_array: *mut CudaRadixCiphertextFFI,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_abs_inplace_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        is_signed: bool,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_abs_inplace_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        ct: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        is_signed: bool,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_abs_inplace(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_are_all_comparisons_block_true_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_are_all_comparisons_block_true_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_in: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        num_radix_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_are_all_comparisons_block_true(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_is_at_least_one_comparisons_block_true_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_is_at_least_one_comparisons_block_true_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaRadixCiphertextFFI,
        lwe_array_in: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        num_radix_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_is_at_least_one_comparisons_block_true(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn extend_radix_with_trivial_zero_blocks_msb_64(
        output: *mut CudaRadixCiphertextFFI,
        input: *const CudaRadixCiphertextFFI,
        streams: CudaStreamsFFI,
    );
}
unsafe extern "C" {
    pub fn trim_radix_blocks_lsb_64(
        output: *mut CudaRadixCiphertextFFI,
        input: *const CudaRadixCiphertextFFI,
        streams: CudaStreamsFFI,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_apply_noise_squashing(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        input_glwe_dimension: u32,
        input_polynomial_size: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_radix_blocks: u32,
        num_original_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_apply_noise_squashing(
        streams: CudaStreamsFFI,
        output_radix_lwe: *mut CudaRadixCiphertextFFI,
        input_radix_lwe: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        ksks: *const *mut ffi::c_void,
        bsks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_apply_noise_squashing(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_sub_and_propagate_single_carry_64_inplace(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        requested_flag: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_sub_and_propagate_single_carry_64_inplace(
        streams: CudaStreamsFFI,
        lhs_array: *mut CudaRadixCiphertextFFI,
        rhs_array: *const CudaRadixCiphertextFFI,
        carry_out: *mut CudaRadixCiphertextFFI,
        carry_in: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        requested_flag: u32,
        uses_carry: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_sub_and_propagate_single_carry(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_unsigned_scalar_div_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_unsigned_scalar_div_radix_64(
        streams: CudaStreamsFFI,
        numerator_ct: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_unsigned_scalar_div_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_extend_radix_with_sign_msb_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        num_additional_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_extend_radix_with_sign_msb_64(
        streams: CudaStreamsFFI,
        output: *mut CudaRadixCiphertextFFI,
        input: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        num_additional_blocks: u32,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_extend_radix_with_sign_msb_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_signed_scalar_div_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_signed_scalar_div_radix_64(
        streams: CudaStreamsFFI,
        numerator_ct: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        numerator_bits: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_signed_scalar_div_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_integer_unsigned_scalar_div_rem_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        active_bits_divisor: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_unsigned_scalar_div_rem_radix_64(
        streams: CudaStreamsFFI,
        quotient_ct: *mut CudaRadixCiphertextFFI,
        remainder_ct: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        divisor_has_at_least_one_set: *const u64,
        decomposed_divisor: *const u64,
        num_scalars_divisor: u32,
        clear_blocks: *const ffi::c_void,
        h_clear_blocks: *const ffi::c_void,
        num_clear_blocks: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_unsigned_scalar_div_rem_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_integer_signed_scalar_div_rem_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        active_bits_divisor: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_signed_scalar_div_rem_radix_64(
        streams: CudaStreamsFFI,
        quotient_ct: *mut CudaRadixCiphertextFFI,
        remainder_ct: *mut CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
        scalar_divisor_ffi: *const CudaScalarDivisorFFI,
        divisor_has_at_least_one_set: *const u64,
        decomposed_divisor: *const u64,
        num_scalars_divisor: u32,
        numerator_bits: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_signed_scalar_div_rem_radix_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_integer_count_of_consecutive_bits_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks: u32,
        counter_num_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        direction: Direction,
        bit_value: BitValue,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_count_of_consecutive_bits_64(
        streams: CudaStreamsFFI,
        output_ct: *mut CudaRadixCiphertextFFI,
        input_ct: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_count_of_consecutive_bits_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_grouped_oprf_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks_to_process: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        message_bits_per_block: u32,
        total_random_bits: u32,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_grouped_oprf_64(
        streams: CudaStreamsFFI,
        radix_lwe_out: *mut CudaRadixCiphertextFFI,
        seeded_lwe_input: *const ffi::c_void,
        num_blocks_to_process: u32,
        mem: *mut i8,
        bsks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_grouped_oprf_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_grouped_oprf_custom_range_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks_intermediate: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        message_bits_per_block: u32,
        num_input_random_bits: u32,
        num_scalar_bits: u32,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_grouped_oprf_custom_range_64(
        streams: CudaStreamsFFI,
        radix_lwe_out: *mut CudaRadixCiphertextFFI,
        num_blocks_intermediate: u32,
        seeded_lwe_input: *const ffi::c_void,
        decomposed_scalar: *const u64,
        has_at_least_one_set: *const u64,
        num_scalars: u32,
        shift: u32,
        mem: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_grouped_oprf_custom_range_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_integer_ilog2_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        input_num_blocks: u32,
        counter_num_blocks: u32,
        num_bits_in_ciphertext: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_ilog2_64(
        streams: CudaStreamsFFI,
        output_ct: *mut CudaRadixCiphertextFFI,
        input_ct: *const CudaRadixCiphertextFFI,
        trivial_ct_neg_n: *const CudaRadixCiphertextFFI,
        trivial_ct_2: *const CudaRadixCiphertextFFI,
        trivial_ct_m_minus_1_block: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_ilog2_64(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_compress_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        compression_glwe_dimension: u32,
        compression_polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        lwe_per_glwe: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_decompress_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        encryption_glwe_dimension: u32,
        encryption_polynomial_size: u32,
        compression_glwe_dimension: u32,
        compression_polynomial_size: u32,
        lwe_dimension: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_blocks_to_decompress: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_compress_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        glwe_array_out: *mut CudaPackedGlweCiphertextListFFI,
        lwe_array_in: *const CudaLweCiphertextListFFI,
        fp_ksk: *const *mut ffi::c_void,
        mem_ptr: *mut i8,
    );
}
unsafe extern "C" {
    pub fn cuda_integer_decompress_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaLweCiphertextListFFI,
        glwe_in: *const CudaPackedGlweCiphertextListFFI,
        indexes_array: *const u32,
        bsks: *const *mut ffi::c_void,
        mem_ptr: *mut i8,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_compress_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_decompress_radix_ciphertext_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_compress_radix_ciphertext_128(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        compression_glwe_dimension: u32,
        compression_polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        lwe_per_glwe: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_decompress_radix_ciphertext_128(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        compression_glwe_dimension: u32,
        compression_polynomial_size: u32,
        lwe_dimension: u32,
        num_radix_blocks: u32,
        message_modulus: u32,
        carry_modulus: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_compress_radix_ciphertext_128(
        streams: CudaStreamsFFI,
        glwe_array_out: *mut CudaPackedGlweCiphertextListFFI,
        lwe_array_in: *const CudaLweCiphertextListFFI,
        fp_ksk: *const *mut ffi::c_void,
        mem_ptr: *mut i8,
    );
}
unsafe extern "C" {
    pub fn cuda_integer_decompress_radix_ciphertext_128(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut CudaLweCiphertextListFFI,
        glwe_in: *const CudaPackedGlweCiphertextListFFI,
        indexes_array: *const u32,
        mem_ptr: *mut i8,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_compress_radix_ciphertext_128(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_decompress_radix_ciphertext_128(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_rerand_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        lwe_ciphertext_count: u32,
        message_modulus: u32,
        carry_modulus: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_rerand_64(
        streams: CudaStreamsFFI,
        lwe_array: *mut ffi::c_void,
        lwe_flattened_encryptions_of_zero_compact_array_in: *const ffi::c_void,
        mem_ptr: *mut i8,
        ksk: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_rerand(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_aes_encrypt_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
        num_aes_inputs: u32,
        sbox_parallelism: u32,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_aes_ctr_encrypt_64(
        streams: CudaStreamsFFI,
        output: *mut CudaRadixCiphertextFFI,
        iv: *const CudaRadixCiphertextFFI,
        round_keys: *const CudaRadixCiphertextFFI,
        counter_bits_le_all_blocks: *const u64,
        num_aes_inputs: u32,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_aes_encrypt_64(streams: CudaStreamsFFI, mem_ptr_void: *mut *mut i8);
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_key_expansion_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_key_expansion_64(
        streams: CudaStreamsFFI,
        expanded_keys: *mut CudaRadixCiphertextFFI,
        key: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_key_expansion_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cuda_integer_aes_ctr_256_encrypt_64(
        streams: CudaStreamsFFI,
        output: *mut CudaRadixCiphertextFFI,
        iv: *const CudaRadixCiphertextFFI,
        round_keys: *const CudaRadixCiphertextFFI,
        counter_bits_le_all_blocks: *const u64,
        num_aes_inputs: u32,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_integer_key_expansion_256_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        lwe_dimension: u32,
        ks_level: u32,
        ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_integer_key_expansion_256_64(
        streams: CudaStreamsFFI,
        expanded_keys: *mut CudaRadixCiphertextFFI,
        key: *const CudaRadixCiphertextFFI,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        ksks: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_integer_key_expansion_256_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
pub const KS_TYPE_BIG_TO_SMALL: KS_TYPE = 0;
pub const KS_TYPE_SMALL_TO_BIG: KS_TYPE = 1;
pub type KS_TYPE = ffi::c_uint;
unsafe extern "C" {
    pub fn scratch_cuda_expand_without_verification_64(
        streams: CudaStreamsFFI,
        mem_ptr: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        big_lwe_dimension: u32,
        small_lwe_dimension: u32,
        computing_ks_level: u32,
        computing_ks_base_log: u32,
        casting_input_dimension: u32,
        casting_output_dimension: u32,
        casting_ks_level: u32,
        casting_ks_base_log: u32,
        pbs_level: u32,
        pbs_base_log: u32,
        grouping_factor: u32,
        num_lwes_per_compact_list: *const u32,
        is_boolean_array: *const bool,
        num_compact_lists: u32,
        message_modulus: u32,
        carry_modulus: u32,
        pbs_type: PBS_TYPE,
        casting_key_type: KS_TYPE,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_expand_without_verification_64(
        streams: CudaStreamsFFI,
        lwe_array_out: *mut ffi::c_void,
        lwe_flattened_compact_array_in: *const ffi::c_void,
        mem_ptr: *mut i8,
        bsks: *const *mut ffi::c_void,
        computing_ksks: *const *mut ffi::c_void,
        casting_keys: *const *mut ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn cleanup_expand_without_verification_64(
        streams: CudaStreamsFFI,
        mem_ptr_void: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cuda_keyswitch_lwe_ciphertext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        ksk: *const ffi::c_void,
        lwe_dimension_in: u32,
        lwe_dimension_out: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_keyswitch_lwe_ciphertext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        ksk: *const ffi::c_void,
        lwe_dimension_in: u32,
        lwe_dimension_out: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_packing_keyswitch_lwe_list_to_glwe_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        fp_ks_buffer: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        num_lwes: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_packing_keyswitch_lwe_list_to_glwe_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        glwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        fp_ksk_array: *const ffi::c_void,
        fp_ks_buffer: *mut i8,
        input_lwe_dimension: u32,
        output_glwe_dimension: u32,
        output_polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_lwes: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_packing_keyswitch_lwe_list_to_glwe_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        fp_ks_buffer: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        num_lwes: u32,
        allocate_gpu_memory: bool,
    );
}
unsafe extern "C" {
    pub fn cuda_packing_keyswitch_lwe_list_to_glwe_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        glwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        fp_ksk_array: *const ffi::c_void,
        fp_ks_buffer: *mut i8,
        input_lwe_dimension: u32,
        output_glwe_dimension: u32,
        output_polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_lwes: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_packing_keyswitch_lwe_list_to_glwe(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        fp_ks_buffer: *mut *mut i8,
        gpu_memory_allocated: bool,
    );
}
unsafe extern "C" {
    pub fn cuda_negate_lwe_ciphertext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_negate_lwe_ciphertext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_add_lwe_ciphertext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        output: *mut CudaRadixCiphertextFFI,
        input_1: *const CudaRadixCiphertextFFI,
        input_2: *const CudaRadixCiphertextFFI,
    );
}
unsafe extern "C" {
    pub fn cuda_add_lwe_ciphertext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        output: *mut CudaRadixCiphertextFFI,
        input_1: *const CudaRadixCiphertextFFI,
        input_2: *const CudaRadixCiphertextFFI,
    );
}
unsafe extern "C" {
    pub fn cuda_add_lwe_ciphertext_vector_plaintext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        plaintext_array_in: *const ffi::c_void,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_add_lwe_ciphertext_vector_plaintext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        plaintext_array_in: *const ffi::c_void,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_mult_lwe_ciphertext_vector_cleartext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        cleartext_array_in: *const ffi::c_void,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_mult_lwe_ciphertext_vector_cleartext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        cleartext_array_in: *const ffi::c_void,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_wrapping_polynomial_mul_one_to_many_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        polynomial_size: u32,
        circulant_buf: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cleanup_wrapping_polynomial_mul_one_to_many_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        circulant_buf: *mut i8,
    );
}
unsafe extern "C" {
    pub fn cuda_wrapping_polynomial_mul_one_to_many_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        result: *mut ffi::c_void,
        poly_lhs: *const ffi::c_void,
        circulant: *mut i8,
        poly_rhs: *const ffi::c_void,
        polynomial_size: u32,
        n_rhs: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_glwe_wrapping_polynomial_mul_one_to_many_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        result: *mut ffi::c_void,
        poly_lhs: *const ffi::c_void,
        circulant: *mut i8,
        poly_rhs: *const ffi::c_void,
        polynomial_size: u32,
        glwe_dimension: u32,
        n_rhs: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_add_lwe_ciphertext_vector_plaintext_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        plaintext_in: u64,
        input_lwe_dimension: u32,
        input_lwe_ciphertext_count: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_fourier_transform_forward_as_torus_f128_async(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        re0: *mut ffi::c_void,
        re1: *mut ffi::c_void,
        im0: *mut ffi::c_void,
        im1: *mut ffi::c_void,
        standard: *const ffi::c_void,
        N: u32,
        number_of_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_fourier_transform_forward_as_integer_f128_async(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        re0: *mut ffi::c_void,
        re1: *mut ffi::c_void,
        im0: *mut ffi::c_void,
        im1: *mut ffi::c_void,
        standard: *const ffi::c_void,
        N: u32,
        number_of_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_fourier_transform_backward_as_torus_f128_async(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        standard: *mut ffi::c_void,
        re0: *const ffi::c_void,
        re1: *const ffi::c_void,
        im0: *const ffi::c_void,
        im1: *const ffi::c_void,
        N: u32,
        number_of_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_fourier_polynomial_mul(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        input1: *const ffi::c_void,
        input2: *const ffi::c_void,
        output: *mut ffi::c_void,
        polynomial_size: u32,
        total_polynomials: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_convert_lwe_programmable_bootstrap_key_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        input_lwe_dim: u32,
        glwe_dim: u32,
        level_count: u32,
        polynomial_size: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_convert_lwe_programmable_bootstrap_key_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        input_lwe_dim: u32,
        glwe_dim: u32,
        level_count: u32,
        polynomial_size: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_convert_lwe_programmable_bootstrap_key_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        input_lwe_dim: u32,
        glwe_dim: u32,
        level_count: u32,
        polynomial_size: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_programmable_bootstrap_amortized_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_programmable_bootstrap_amortized_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_programmable_bootstrap_amortized_lwe_ciphertext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lut_vector: *const ffi::c_void,
        lut_vector_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        pbs_buffer: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_programmable_bootstrap_amortized_lwe_ciphertext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lut_vector: *const ffi::c_void,
        lut_vector_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        pbs_buffer: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_programmable_bootstrap_amortized(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_programmable_bootstrap_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        buffer: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        level_count: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_programmable_bootstrap_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        buffer: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        level_count: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn scratch_cuda_programmable_bootstrap_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        buffer: *mut *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        level_count: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
        noise_reduction_type: PBS_MS_REDUCTION_T,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_programmable_bootstrap_lwe_ciphertext_vector_32(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lut_vector: *const ffi::c_void,
        lut_vector_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        buffer: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
        num_many_lut: u32,
        lut_stride: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_programmable_bootstrap_lwe_ciphertext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lut_vector: *const ffi::c_void,
        lut_vector_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        buffer: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
        num_many_lut: u32,
        lut_stride: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_programmable_bootstrap_lwe_ciphertext_vector_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lut_vector: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        buffer: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_programmable_bootstrap(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_programmable_bootstrap_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn has_support_to_cuda_programmable_bootstrap_cg_multi_bit(
        glwe_dimension: u32,
        polynomial_size: u32,
        level_count: u32,
        num_samples: u32,
        max_shared_memory: u32,
    ) -> bool;
}
unsafe extern "C" {
    pub fn cuda_convert_lwe_multi_bit_programmable_bootstrap_key_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        input_lwe_dim: u32,
        glwe_dim: u32,
        level_count: u32,
        polynomial_size: u32,
        grouping_factor: u32,
    );
}
unsafe extern "C" {
    pub fn cuda_convert_lwe_multi_bit_programmable_bootstrap_key_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        dest: *mut ffi::c_void,
        src: *const ffi::c_void,
        input_lwe_dim: u32,
        glwe_dim: u32,
        level_count: u32,
        polynomial_size: u32,
        grouping_factor: u32,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_multi_bit_programmable_bootstrap_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        level_count: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_multi_bit_programmable_bootstrap_lwe_ciphertext_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lut_vector: *const ffi::c_void,
        lut_vector_indexes: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        buffer: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        grouping_factor: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
        num_many_lut: u32,
        lut_stride: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_multi_bit_programmable_bootstrap(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        pbs_buffer: *mut *mut i8,
    );
}
unsafe extern "C" {
    pub fn scratch_cuda_multi_bit_programmable_bootstrap_128_vector_64(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        buffer: *mut *mut i8,
        glwe_dimension: u32,
        polynomial_size: u32,
        level_count: u32,
        input_lwe_ciphertext_count: u32,
        allocate_gpu_memory: bool,
    ) -> u64;
}
unsafe extern "C" {
    pub fn cuda_multi_bit_programmable_bootstrap_lwe_ciphertext_vector_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        lwe_array_out: *mut ffi::c_void,
        lwe_output_indexes: *const ffi::c_void,
        lut_vector: *const ffi::c_void,
        lwe_array_in: *const ffi::c_void,
        lwe_input_indexes: *const ffi::c_void,
        bootstrapping_key: *const ffi::c_void,
        mem_ptr: *mut i8,
        lwe_dimension: u32,
        glwe_dimension: u32,
        polynomial_size: u32,
        grouping_factor: u32,
        base_log: u32,
        level_count: u32,
        num_samples: u32,
        num_many_lut: u32,
        lut_stride: u32,
    );
}
unsafe extern "C" {
    pub fn cleanup_cuda_multi_bit_programmable_bootstrap_128(
        stream: *mut ffi::c_void,
        gpu_index: u32,
        buffer: *mut *mut i8,
    );
}
