From 3a942b96af057e7e1ba5b4ce19a9aafdb17143c2 Mon Sep 17 00:00:00 2001 From: Lucas Clemente Vella Date: Thu, 21 Nov 2024 19:50:42 +0000 Subject: [PATCH] Using a feature to activate powdr acceleration. --- plonky3/Cargo.toml | 2 ++ plonky3/src/params/poseidon2/goldilocks/mod.rs | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plonky3/Cargo.toml b/plonky3/Cargo.toml index d9d52be780..1c66ed9b77 100644 --- a/plonky3/Cargo.toml +++ b/plonky3/Cargo.toml @@ -22,6 +22,8 @@ nightly-features = [ "p3-mersenne-31/nightly-features", "p3-poseidon2/nightly-features", ] +# As a guest in powdr, use accelerated machines. +powdr-accel = [] [dependencies] powdr-ast.workspace = true diff --git a/plonky3/src/params/poseidon2/goldilocks/mod.rs b/plonky3/src/params/poseidon2/goldilocks/mod.rs index 67d157e3eb..b8d3c436e3 100644 --- a/plonky3/src/params/poseidon2/goldilocks/mod.rs +++ b/plonky3/src/params/poseidon2/goldilocks/mod.rs @@ -1,13 +1,14 @@ -#[cfg(not(all(target_os = "zkvm", target_arch = "riscv32")))] +#[cfg(not(feature = "powdr-accel"))] mod software_impl; -#[cfg(not(all(target_os = "zkvm", target_arch = "riscv32")))] +#[cfg(not(feature = "powdr-accel"))] pub use software_impl::*; -#[cfg(all(target_os = "zkvm", target_arch = "riscv32"))] +#[cfg(feature = "powdr-accel")] mod powdr_accel_impl; -#[cfg(all(target_os = "zkvm", target_arch = "riscv32"))] +#[cfg(feature = "powdr-accel")] pub use powdr_accel_impl::*; + use lazy_static::lazy_static; use p3_goldilocks::Goldilocks; use p3_poseidon2::poseidon2_round_numbers_128;