Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arithmetic op counts to InfoEvaluator #832

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions crates/prover/src/constraint_framework/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ impl<E: FrameworkEval + Sync> ComponentProver<SimdBackend> for FrameworkComponen
.step_by(CHUNK_SIZE)
.zip(col.chunks_mut(CHUNK_SIZE));

// Define any `self` values outside the loop to prevent the compiler thinking there is a
// `Sync` requirement on `Self`.
let self_eval = &self.eval;
let self_logup_sums = self.logup_sums;

iter.for_each(|(chunk_idx, mut chunk)| {
let trace_cols = trace.as_cols_ref().map_cols(|c| c.as_ref());

Expand All @@ -344,10 +349,10 @@ impl<E: FrameworkEval + Sync> ComponentProver<SimdBackend> for FrameworkComponen
&accum.random_coeff_powers,
trace_domain.log_size(),
eval_domain.log_size(),
self.eval.log_size(),
self.logup_sums,
self_eval.log_size(),
self_logup_sums,
);
let row_res = self.eval.evaluate(eval).row_res;
let row_res = self_eval.evaluate(eval).row_res;

// Finalize row.
unsafe {
Expand Down
7 changes: 7 additions & 0 deletions crates/prover/src/constraint_framework/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ impl FieldExpOps for Expr {
}
}

impl Add<BaseField> for Expr {
type Output = Self;
fn add(self, rhs: BaseField) -> Self {
self + Expr::from(rhs)
}
}

impl Mul<BaseField> for Expr {
type Output = Self;
fn mul(self, rhs: BaseField) -> Self {
Expand Down
Loading
Loading