diff --git a/crypto3.nix b/crypto3.nix index d9bda7d513..50d7b58ab4 100644 --- a/crypto3.nix +++ b/crypto3.nix @@ -11,6 +11,7 @@ enableDebug ? false, runTests ? false, sanitize ? false, + benchmarkTests ? 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 benchmarkTests 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; diff --git a/flake.nix b/flake.nix index b15ec32710..d3d0feb429 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,12 @@ runTests = true; enableDebug = false; sanitize = true; - bench = true; + benchmarkTests = true; + }); + crypto3-clang-bench = (pkgs.callPackage ./crypto3.nix { + runTests = true; + enableDebug = false; + benchmarkTests = true; }); crypto3-clang-debug = (pkgs.callPackage ./crypto3.nix { stdenv = pkgs.llvmPackages_19.stdenv; @@ -108,6 +113,11 @@ runTests = true; enableDebug = false; }); + crypto3-gcc-bench = (pkgs.callPackage ./crypto3.nix { + runTests = true; + enableDebug = false; + benchmarkTests = true; + }); crypto3-clang = (pkgs.callPackage ./crypto3.nix { stdenv = pkgs.llvmPackages_19.stdenv; runTests = true; @@ -124,7 +134,7 @@ runTests = true; enableDebug = false; sanitize = true; - bench = true; + benchmarkTests = true; }); parallel-crypto3-gcc = (pkgs.callPackage ./parallel-crypto3.nix {