Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gpu): fix inconsistency in the use of AmortizedDegree #1898

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ void cuda_programmable_bootstrap_tbc_lwe_ciphertext_vector(
num_many_lut, lut_stride);
break;
case 512:
host_programmable_bootstrap_tbc<Torus, Degree<512>>(
host_programmable_bootstrap_tbc<Torus, AmortizedDegree<512>>(
static_cast<cudaStream_t>(stream), gpu_index, lwe_array_out,
lwe_output_indexes, lut_vector, lut_vector_indexes, lwe_array_in,
lwe_input_indexes, bootstrapping_key, buffer, glwe_dimension,
lwe_dimension, polynomial_size, base_log, level_count, num_samples,
num_many_lut, lut_stride);
break;
case 1024:
host_programmable_bootstrap_tbc<Torus, Degree<1024>>(
host_programmable_bootstrap_tbc<Torus, AmortizedDegree<1024>>(
static_cast<cudaStream_t>(stream), gpu_index, lwe_array_out,
lwe_output_indexes, lut_vector, lut_vector_indexes, lwe_array_in,
lwe_input_indexes, bootstrapping_key, buffer, glwe_dimension,
Expand Down Expand Up @@ -393,15 +393,15 @@ void cuda_programmable_bootstrap_cg_lwe_ciphertext_vector(
num_many_lut, lut_stride);
break;
case 512:
host_programmable_bootstrap_cg<Torus, Degree<512>>(
host_programmable_bootstrap_cg<Torus, AmortizedDegree<512>>(
static_cast<cudaStream_t>(stream), gpu_index, lwe_array_out,
lwe_output_indexes, lut_vector, lut_vector_indexes, lwe_array_in,
lwe_input_indexes, bootstrapping_key, buffer, glwe_dimension,
lwe_dimension, polynomial_size, base_log, level_count, num_samples,
num_many_lut, lut_stride);
break;
case 1024:
host_programmable_bootstrap_cg<Torus, Degree<1024>>(
host_programmable_bootstrap_cg<Torus, AmortizedDegree<1024>>(
static_cast<cudaStream_t>(stream), gpu_index, lwe_array_out,
lwe_output_indexes, lut_vector, lut_vector_indexes, lwe_array_in,
lwe_input_indexes, bootstrapping_key, buffer, glwe_dimension,
Expand Down Expand Up @@ -468,15 +468,15 @@ void cuda_programmable_bootstrap_lwe_ciphertext_vector(
num_many_lut, lut_stride);
break;
case 512:
host_programmable_bootstrap<Torus, Degree<512>>(
host_programmable_bootstrap<Torus, AmortizedDegree<512>>(
static_cast<cudaStream_t>(stream), gpu_index, lwe_array_out,
lwe_output_indexes, lut_vector, lut_vector_indexes, lwe_array_in,
lwe_input_indexes, bootstrapping_key, buffer, glwe_dimension,
lwe_dimension, polynomial_size, base_log, level_count, num_samples,
num_many_lut, lut_stride);
break;
case 1024:
host_programmable_bootstrap<Torus, Degree<1024>>(
host_programmable_bootstrap<Torus, AmortizedDegree<1024>>(
static_cast<cudaStream_t>(stream), gpu_index, lwe_array_out,
lwe_output_indexes, lut_vector, lut_vector_indexes, lwe_array_in,
lwe_input_indexes, bootstrapping_key, buffer, glwe_dimension,
Expand Down
20 changes: 10 additions & 10 deletions tfhe/src/core_crypto/gpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Drop for CudaStreams {
}
}

/// Discarding bootstrap on a vector of LWE ciphertexts
/// Programmable bootstrap on a vector of LWE ciphertexts
///
/// # Safety
///
Expand Down Expand Up @@ -150,7 +150,7 @@ pub unsafe fn programmable_bootstrap_async<T: UnsignedInteger>(
);
}

/// Discarding bootstrap on a vector of LWE ciphertexts
/// Programmable multi-bit bootstrap on a vector of LWE ciphertexts
///
/// # Safety
///
Expand Down Expand Up @@ -215,7 +215,7 @@ pub unsafe fn programmable_bootstrap_multi_bit_async<T: UnsignedInteger>(
);
}

/// Discarding keyswitch on a vector of LWE ciphertexts
/// Keyswitch on a vector of LWE ciphertexts
///
/// # Safety
///
Expand Down Expand Up @@ -408,7 +408,7 @@ pub unsafe fn extract_lwe_samples_from_glwe_ciphertext_list_async<T: UnsignedInt
);
}

/// Discarding addition of a vector of LWE ciphertexts
/// Addition of a vector of LWE ciphertexts
///
/// # Safety
///
Expand All @@ -433,7 +433,7 @@ pub unsafe fn add_lwe_ciphertext_vector_async<T: UnsignedInteger>(
);
}

/// Discarding assigned addition of a vector of LWE ciphertexts
/// Assigned addition of a vector of LWE ciphertexts
///
/// # Safety
///
Expand All @@ -457,7 +457,7 @@ pub unsafe fn add_lwe_ciphertext_vector_assign_async<T: UnsignedInteger>(
);
}

/// Discarding addition of a vector of LWE ciphertexts with a vector of plaintexts
/// Addition of a vector of LWE ciphertexts with a vector of plaintexts
///
/// # Safety
///
Expand All @@ -482,7 +482,7 @@ pub unsafe fn add_lwe_ciphertext_vector_plaintext_vector_async<T: UnsignedIntege
);
}

/// Discarding assigned addition of a vector of LWE ciphertexts with a vector of plaintexts
/// Assigned addition of a vector of LWE ciphertexts with a vector of plaintexts
///
/// # Safety
///
Expand All @@ -506,7 +506,7 @@ pub unsafe fn add_lwe_ciphertext_vector_plaintext_vector_assign_async<T: Unsigne
);
}

/// Discarding negation of a vector of LWE ciphertexts
/// Negation of a vector of LWE ciphertexts
///
/// # Safety
///
Expand All @@ -529,7 +529,7 @@ pub unsafe fn negate_lwe_ciphertext_vector_async<T: UnsignedInteger>(
);
}

/// Discarding assigned negation of a vector of LWE ciphertexts
/// Assigned negation of a vector of LWE ciphertexts
///
/// # Safety
///
Expand All @@ -552,7 +552,7 @@ pub unsafe fn negate_lwe_ciphertext_vector_assign_async<T: UnsignedInteger>(
}

#[allow(clippy::too_many_arguments)]
/// Discarding assign negation of a vector of LWE ciphertexts representing an integer
/// Assign negation of a vector of LWE ciphertexts representing an integer
///
/// # Safety
///
Expand Down
Loading