Skip to content

Commit

Permalink
chore(bench): benchmark 4 bits integer operations
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Mar 1, 2024
1 parent 955495d commit bd7547c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tfhe/benches/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ pub fn write_to_json<
}

const FAST_BENCH_BIT_SIZES: [usize; 1] = [32];
const BENCH_BIT_SIZES: [usize; 7] = [8, 16, 32, 40, 64, 128, 256];
const BENCH_BIT_SIZES: [usize; 8] = [4, 8, 16, 32, 40, 64, 128, 256];
const MULTI_BIT_CPU_SIZES: [usize; 6] = [4, 8, 16, 32, 40, 64];

/// User configuration in which benchmarks must be run.
#[derive(Default)]
Expand Down Expand Up @@ -258,16 +259,14 @@ impl EnvConfig {
/// Get precisions values to benchmark.
#[allow(dead_code)]
pub fn bit_sizes(&self) -> Vec<usize> {
if self.is_multi_bit {
if self.is_fast_bench {
FAST_BENCH_BIT_SIZES.to_vec()
} else if cfg!(feature = "gpu") {
if self.is_fast_bench {
FAST_BENCH_BIT_SIZES.to_vec()
} else if self.is_multi_bit {
if cfg!(feature = "gpu") {
BENCH_BIT_SIZES.to_vec()
} else {
vec![8, 16, 32, 40, 64]
MULTI_BIT_CPU_SIZES.to_vec()
}
} else if self.is_fast_bench {
FAST_BENCH_BIT_SIZES.to_vec()
} else {
BENCH_BIT_SIZES.to_vec()
}
Expand Down

0 comments on commit bd7547c

Please sign in to comment.