Skip to content

Commit 3d9f1f0

Browse files
committed
core: more calls counters for precompiles
1 parent c1d612b commit 3d9f1f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/leanVm/src/core.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pub struct VirtualMachine<Perm16, Perm24> {
2929
pub(crate) cpu_cycles: u64,
3030
pub(crate) poseidon16_calls: u64,
3131
pub(crate) poseidon24_calls: u64,
32+
pub(crate) dot_product_calls: u64,
33+
pub(crate) multilinear_eval_calls: u64,
3234
// A string buffer to hold output from the Print hint.
3335
pub(crate) std_out: String,
3436
}
@@ -51,6 +53,8 @@ where
5153
cpu_cycles: 0,
5254
poseidon16_calls: 0,
5355
poseidon24_calls: 0,
56+
dot_product_calls: 0,
57+
multilinear_eval_calls: 0,
5458
std_out: String::new(),
5559
}
5660
}
@@ -287,6 +291,8 @@ where
287291
self.cpu_cycles = 0;
288292
self.poseidon16_calls = 0;
289293
self.poseidon24_calls = 0;
294+
self.dot_product_calls = 0;
295+
self.multilinear_eval_calls = 0;
290296
self.std_out.clear();
291297
}
292298

@@ -295,6 +301,8 @@ where
295301
match instruction {
296302
Instruction::Poseidon2_16(_) => self.poseidon16_calls += 1,
297303
Instruction::Poseidon2_24(_) => self.poseidon24_calls += 1,
304+
Instruction::DotProduct(_) => self.dot_product_calls += 1,
305+
Instruction::MultilinearEval(_) => self.multilinear_eval_calls += 1,
298306
_ => (), // Other instructions do not have special counters.
299307
}
300308
}

0 commit comments

Comments
 (0)