chore(core_crypto): enable the choice of a single fixed fft algorithm

This commit is contained in:
Arthur Meyre
2023-03-27 11:15:48 +02:00
parent c4769cbc0f
commit 7f050c0fe9
2 changed files with 21 additions and 4 deletions

View File

@@ -68,6 +68,7 @@ internal-keycache = ["lazy_static", "fs2", "bincode"]
# Experimental section
experimental = ["experimental-multi_bit_pbs"]
experimental-multi_bit_pbs = []
experimental-force_fft_algo_dif4 = []
# End experimental section
__c_api = ["cbindgen", "bincode"]

View File

@@ -153,10 +153,26 @@ impl Fft {
plan.map(|p| {
p.get_or_init(|| {
Arc::new((
Twisties::new(n / 2),
Plan::new(n / 2, Method::Measure(Duration::from_millis(10))),
))
#[cfg(not(feature = "experimental-force_fft_algo_dif4"))]
{
Arc::new((
Twisties::new(n / 2),
Plan::new(n / 2, Method::Measure(Duration::from_millis(10))),
))
}
#[cfg(feature = "experimental-force_fft_algo_dif4")]
{
Arc::new((
Twisties::new(n / 2),
Plan::new(
n / 2,
Method::UserProvided {
base_algo: concrete_fft::ordered::FftAlgo::Dif4,
base_n: n / 2,
},
),
))
}
})
.clone()
})