80 for (
const auto& u_k : challenge) {
145 const size_t log_num_monomials,
146 const FF& scaling_factor =
FF(1))
148 BB_BENCH_NAME(
"GateSeparatorPolynomial::compute_beta_products");
149 size_t pow_size = 1 << log_num_monomials;
157 size_t min_iterations_per_thread = 1 << 6;
158 size_t desired_num_threads = pow_size / min_iterations_per_thread;
159 size_t num_threads = std::min(desired_num_threads, max_num_threads);
160 num_threads = num_threads > 0 ? num_threads : 1;
161 size_t iterations_per_thread = pow_size / num_threads;
162 const size_t num_betas_per_thread =
numeric::get_msb(iterations_per_thread);
184 std::vector<FF> thread_prefix_beta_products(num_threads);
185 thread_prefix_beta_products.at(0) = scaling_factor;
195 for (
size_t beta_idx = num_betas_per_thread, window_size = 1; beta_idx < log_num_monomials;
196 beta_idx++, window_size <<= 1) {
197 const auto& beta =
betas.at(beta_idx);
198 for (
size_t j = 0; j < window_size; j++) {
199 thread_prefix_beta_products.at(window_size + j) = beta * thread_prefix_beta_products.at(j);
204 size_t start = thread_idx * iterations_per_thread;
213 for (
size_t beta_idx = 0, window_size = 1; beta_idx < num_betas_per_thread; beta_idx++, window_size <<= 1) {
214 const auto& beta =
betas.at(beta_idx);
215 for (
size_t j = 0; j < window_size; j++) {
#define BB_BENCH_NAME(name)
Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x .....
Fr & at(size_t index)
Our mutable accessor, unlike operator[]. We abuse precedent a bit to differentiate at() and operator[...
constexpr T get_msb(const T in)
Entry point for Barretenberg command-line interface.
size_t get_num_cpus_pow2()
void parallel_for(size_t num_iterations, const std::function< void(size_t)> &func)
Implementation of the methods for the -polynomials used in in Sumcheck.
GateSeparatorPolynomial(const std::vector< FF > &betas)
Construct a new GateSeparatorPolynomial object without expanding to a vector of monomials.
size_t periodicity
In Round of Sumcheck, the periodicity equals to and represents the fixed interval at which elements...
GateSeparatorPolynomial(const std::vector< FF > &betas, const size_t log_num_monomials)
Construct a new GateSeparatorPolynomial.
std::vector< FF > betas
The challenges .
FF current_element() const
Computes the component at index current_element_idx in betas.
FF const & operator[](size_t idx) const
Retruns the element in beta_products at place #idx.
void partially_evaluate(FF challenge)
Partially evaluate the -polynomial at the new challenge and update .
FF univariate_eval(FF challenge) const
Evaluate at the challenge point .
GateSeparatorPolynomial(const std::vector< FF > &betas, const std::vector< FF > &challenge)
Constructs a virtual GateSeparator used by the prover in rounds k > d - 1, and computes its partial e...
FF partial_evaluation_result
The value obtained by partially evaluating one variable in the power polynomial at each round....
void partially_evaluate(const FF &challenge, const FF &indicator)
Partially evaluate the -polynomial at the new challenge and update .
size_t current_element_idx
In Round of Sumcheck, it points to the -th element in .
Polynomial< FF > beta_products
The consecutive evaluations for identified with the integers .
static BB_PROFILE Polynomial< FF > compute_beta_products(const std::vector< FF > &betas, const size_t log_num_monomials, const FF &scaling_factor=FF(1))
Given compute for .