From c047ee700dbc353f544afe5cd4b4c20ceeabe3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Fri, 16 Jan 2026 11:09:28 +0100 Subject: [PATCH] WIP: try inline never on hlapi bench functions --- Makefile | 2 +- tfhe-benchmark/benches/high_level_api/bench.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1856c3d9..e7438894a 100644 --- a/Makefile +++ b/Makefile @@ -1639,7 +1639,7 @@ bench_hlapi: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_BIT_SIZES_SET=$(BIT_SIZES_SET) \ cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \ --bench hlapi \ - --features=integer,internal-keycache,pbs-stats -p tfhe-benchmark -- + --features=integer,internal-keycache,pbs-stats -p tfhe-benchmark -- '::add|::mul|::bitand' .PHONY: bench_hlapi_gpu # Run benchmarks for integer operations on GPU bench_hlapi_gpu: install_rs_check_toolchain diff --git a/tfhe-benchmark/benches/high_level_api/bench.rs b/tfhe-benchmark/benches/high_level_api/bench.rs index 5355e5cea..d673e2914 100644 --- a/tfhe-benchmark/benches/high_level_api/bench.rs +++ b/tfhe-benchmark/benches/high_level_api/bench.rs @@ -330,6 +330,7 @@ where } } +#[inline(never)] fn bench_fhe_type_op( c: &mut Criterion, client_key: &ClientKey, @@ -383,6 +384,7 @@ fn bench_fhe_type_op( macro_rules! bench_type_binary_op { (type_name: $fhe_type:ident, right_type_name: $fhe_right_type:ident,left_type: $left_type:ty, right_type: $right_type:ty, display_name: $display_name:literal, operation: $op:ident) => { ::paste::paste! { + #[inline(never)] fn [](c: &mut Criterion, cks: &ClientKey) { bench_fhe_type_op( c, @@ -413,6 +415,7 @@ macro_rules! bench_type_binary_scalar_op { rng: $rng_fn:expr ) => { ::paste::paste! { + #[inline(never)] fn [](c: &mut Criterion, cks: &ClientKey) { bench_fhe_type_op( c, @@ -435,6 +438,7 @@ macro_rules! bench_type_binary_scalar_op { macro_rules! bench_type_unary_op { (type_name: $fhe_type:ident, integer_type: $integer_type:ty, display_name: $display_name:literal, operation: $op:ident) => { ::paste::paste! { + #[inline(never)] fn [](c: &mut Criterion, cks: &ClientKey) { bench_fhe_type_op( c, @@ -456,6 +460,7 @@ macro_rules! bench_type_unary_op { macro_rules! bench_type_ternary_op { (type_name: $fhe_type:ident, integer_type: $integer_type:ty, display_name: $display_name:literal, operation: $op:ident) => { ::paste::paste! { + #[inline(never)] fn [](c: &mut Criterion, cks: &ClientKey) { bench_fhe_type_op( c, @@ -477,6 +482,7 @@ macro_rules! bench_type_ternary_op { macro_rules! bench_type_array_op { (type_name: $fhe_type:ident, integer_type: $integer_type:ty, display_name: $display_name:literal, operation: $op:ident) => { ::paste::paste! { + #[inline(never)] fn [](c: &mut Criterion, cks: &ClientKey) { bench_fhe_type_op( c,