1#include <benchmark/benchmark.h>
19using namespace benchmark;
27struct FakeUnivariateAllEntities {
34 FakeUnivariateAllEntities()
36 for (DataType&
value : fixed_random_values) {
42 size_t index =
static_cast<size_t>(rand()) % fixed_random_values.size();
43 return fixed_random_values[index];
47FakeUnivariateAllEntities get_random_row()
49 static FakeUnivariateAllEntities instance;
53template <
typename Relation>
auto allocate_result()
64 .public_input_delta = 0,
67 .eccvm_set_permutation_delta = 0,
71template <
typename Relation>
void BM_accumulate_relation(State& state)
73 auto row = get_random_row();
74 auto params = get_params();
75 FF scaling_factor = 1;
77 auto result = allocate_result<Relation>();
79 for (
auto _ : state) {
80 Relation::accumulate(result, row, params, scaling_factor);
84template <
typename Relation>
constexpr size_t get_interactions_count()
88 bb::constexpr_for<0, std::tuple_size_v<AllInteractions>, 1>([&]<
size_t i>() {
90 if constexpr (Relation::NAME == Interaction::RELATION_NAME) {
97template <
typename Relation>
void BM_accumulate_interactions(State& state)
100 bb::constexpr_for<0, std::tuple_size_v<AllInteractions>, 1>([&]<
size_t i>() {
102 if constexpr (Relation::NAME == Interaction::RELATION_NAME) {
103 BM_accumulate_relation<Interaction>(state);
112 bb::constexpr_for<0, std::tuple_size_v<typename AvmFlavor::MainRelations>, 1>([&]<
size_t i>() {
114 BENCHMARK(BM_accumulate_relation<Relation>)->Name(std::string(Relation::NAME) +
"_acc")->Unit(kMicrosecond);
117#ifdef AVM_BENCHMARK_WITH_LOOKUPS
118 if (get_interactions_count<Relation>() > 0) {
119 BENCHMARK(BM_accumulate_interactions<Relation>)
120 ->Name(std::string(Relation::NAME) +
"_interactions_acc")
121 ->Unit(kMicrosecond);
126 ::benchmark::Initialize(&argc, argv);
127 ::benchmark::RunSpecifiedBenchmarks();
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
TupleOfUnivariates< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS > SumcheckTupleOfUnivariatesOverSubrelations
A univariate polynomial represented by its values on {domain_start, domain_start + 1,...
static Univariate random_element()
LookupRelations_< FF > LookupRelations
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
BENCHMARK(extend_2_to_11)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
int main(int argc, char **argv)
Container for parameters used by the grand product (permutation, lookup) Honk relations.
static field random_element(numeric::RNG *engine=nullptr) noexcept