Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lanbones committed Aug 4, 2023
1 parent a833e52 commit 15f2b6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 55 deletions.
37 changes: 2 additions & 35 deletions halo2_proofs/src/plonk/evaluation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ impl<C: CurveAffine> Evaluator<C> {
};
use std::{collections::LinkedList, marker::PhantomData};

use crate::plonk::evaluation_gpu::{do_extended_fft, do_fft, gen_do_extended_fft};
use crate::plonk::evaluation_gpu::{do_extended_fft, gen_do_extended_fft};

assert!(advice_poly.len() == 1);
let timer = start_timer!(|| "expressions gpu eval");
Expand Down Expand Up @@ -947,8 +947,6 @@ impl<C: CurveAffine> Evaluator<C> {
}

let left_buf = unsafe { program.create_buffer::<C::ScalarExt>(size)? };
let mut extended_data_buf =
unsafe { program.create_buffer::<C::ScalarExt>(size)? };

let mut beta_term = vec![delta_start];
for _ in 1..size {
Expand Down Expand Up @@ -992,7 +990,7 @@ impl<C: CurveAffine> Evaluator<C> {
})
.zip(cosets.iter())
{
extended_data_buf =
let extended_data_buf =
do_extended_fft(pk, program, values, allocator, &mut helper)?;

create_buffer_from!(permutation_buf, &permutation.values);
Expand Down Expand Up @@ -1094,37 +1092,6 @@ impl<C: CurveAffine> Evaluator<C> {
create_buffer_from!(l_active_row_buf, l_active_row);
create_buffer_from!(y_beta_gamma_buf, &y_beta_gamma[..]);

const MAX_LOG2_RADIX: u32 = 8;
const LOG2_MAX_ELEMENTS: usize = 32;
const MAX_LOG2_LOCAL_WORK_SIZE: u32 = 7;

let buf = vec![pk.vk.domain.get_extended_omega()];
let omega: &[Fr] = unsafe { std::mem::transmute(&buf[..]) };
let omega = omega[0];
let log_n = domain.extended_k();
let n = 1 << log_n;
let max_deg = cmp::min(MAX_LOG2_RADIX, log_n);

// Precalculate:
// [omega^(0/(2^(deg-1))), omega^(1/(2^(deg-1))), ..., omega^((2^(deg-1)-1)/(2^(deg-1)))]
let mut pq = vec![Fr::zero(); 1 << (max_deg - 1)];
let twiddle: Fr = omega.pow_vartime([(n >> max_deg) as u64]);
pq[0] = Fr::one();
if max_deg > 1 {
pq[1] = twiddle;
for i in 2..(1 << max_deg >> 1) {
pq[i] = pq[i - 1];
pq[i].mul_assign(&twiddle);
}
}
let pq_buffer = program.create_buffer_from_slice(&pq)?;

// Precalculate [omega, omega^2, omega^4, omega^8, ..., omega^(2^31)]
let mut omegas = vec![omega];
for _ in 1..LOG2_MAX_ELEMENTS {
omegas.push(omegas.last().unwrap().square());
}

let mut helper = gen_do_extended_fft(pk, program)?;
let mut allocator = LinkedList::new();

Expand Down
20 changes: 0 additions & 20 deletions halo2_proofs/src/plonk/evaluation_gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,26 +836,6 @@ pub(crate) fn do_extended_fft<F: FieldExt, C: CurveAffine<ScalarExt = F>>(
)
}

#[cfg(feature = "cuda")]
pub(crate) fn do_fft<F: FieldExt, C: CurveAffine<ScalarExt = F>>(
pk: &ProvingKey<C>,
program: &Program,
values: Buffer<F>,
allocator: &mut LinkedList<Buffer<F>>,
pq_buffer: &Buffer<F>,
omegas_buffer: &Buffer<F>,
) -> EcResult<Buffer<F>> {
do_fft_core(
program,
values,
pk.vk.domain.extended_k(),
None,
allocator,
pq_buffer,
omegas_buffer,
)
}

#[cfg(feature = "cuda")]
pub(crate) fn do_fft_pure<F: FieldExt>(
program: &Program,
Expand Down

0 comments on commit 15f2b6b

Please sign in to comment.