From fed52eaff334d1b52f46c3f9a16a722617ebb807 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 26 Nov 2024 14:14:41 +0100 Subject: [PATCH] implement benchmarks derivation --- crypto3.nix | 2 ++ crypto3/benchmarks/CMakeLists.txt | 2 +- crypto3/benchmarks/algebra/curves.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto3.nix b/crypto3.nix index d9bda7d513..4139be2813 100644 --- a/crypto3.nix +++ b/crypto3.nix @@ -11,6 +11,7 @@ enableDebug ? false, runTests ? false, sanitize ? false, + bench ? false, }: let inherit (lib) optional; @@ -34,6 +35,7 @@ in stdenv.mkDerivation { (if runTests then "-DBUILD_CRYPTO3_TESTS=TRUE" else "-DBUILD_CRYPTO3_TESTS=False") (if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release") (if sanitize then "-DSANITIZE=ON" else "-DSANITIZE=OFF") + (if bench then "-DBUILD_CRYPTO3_BENCH_TESTS=ON" else "-DBUILD_CRYPTO3_BENCH_TESTS=OFF") "-G Ninja" ]; diff --git a/crypto3/benchmarks/CMakeLists.txt b/crypto3/benchmarks/CMakeLists.txt index c1f19f6dde..4e1c9528c1 100644 --- a/crypto3/benchmarks/CMakeLists.txt +++ b/crypto3/benchmarks/CMakeLists.txt @@ -60,7 +60,7 @@ set(BENCHMARK_NAMES "multiprecision/modular_adaptor_fixed" - "zk/lpc" + #"zk/lpc" "zk/pedersen" ) diff --git a/crypto3/benchmarks/algebra/curves.cpp b/crypto3/benchmarks/algebra/curves.cpp index 67264be342..50c4e33253 100644 --- a/crypto3/benchmarks/algebra/curves.cpp +++ b/crypto3/benchmarks/algebra/curves.cpp @@ -113,7 +113,7 @@ void benchmark_curve_operations(std::string const& curve_name) return A *= B; }); - if constexpr (has_template_g2_type::value) { + if constexpr (has_type_g2_type::value) { using g2_type = typename curve_type::template g2_type<>; using g2_field = typename g2_type::field_type;