Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyong1997 committed Sep 15, 2024
1 parent e7f1a15 commit 7a50da5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/mpi_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl MPIToolKit {
}

/// Root process broadcase a value f into all the processes
pub fn root_broadcast<F: Field>(f: &F) {
pub fn root_broadcast<F: Field>(f: &mut F) {
unsafe {
if MPI_SIZE == 1 {
} else {
Expand All @@ -107,7 +107,7 @@ impl MPIToolKit {
}
}

///
/// sum up all local values
pub fn sum_vec<F: Field>(local_vec: &Vec<F>) -> Vec<F> {
unsafe {
if MPI_SIZE == 1 {
Expand All @@ -129,8 +129,8 @@ impl MPIToolKit {
}
}

///
pub fn coef_combine_vec<F: Field>(local_vec: &Vec<F>, coef: &Vec<F>) -> Vec<F> {
/// coef has a length of mpi_world_size
pub fn coef_combine_vec<F: Field>(local_vec: &Vec<F>, coef: &[F]) -> Vec<F> {
unsafe {
if MPI_SIZE == 1 {
// Warning: literally, it should be coef[0] * local_vec
Expand Down
9 changes: 4 additions & 5 deletions src/prover/gkr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,18 @@ pub fn gkr_prove<C: GKRConfig>(
&mut sp.eq_evals_at_r_simd0,
);

let claimed_v: C::ChallengeField;
if MPIToolKit::is_root() {
let claimed_v = if MPIToolKit::is_root() {
let mut claimed_v_gathering_buffer =
vec![C::ChallengeField::zero(); MPIToolKit::world_size()];
MPIToolKit::gather_vec(&vec![claimed_v_local], &mut claimed_v_gathering_buffer);
claimed_v = MultiLinearPoly::eval_generic(
MultiLinearPoly::eval_generic(
&claimed_v_gathering_buffer,
&r_mpi,
&mut sp.eq_evals_at_r_mpi0,
);
)
} else {
MPIToolKit::gather_vec(&vec![claimed_v_local], &mut vec![]);
claimed_v = C::ChallengeField::zero();
C::ChallengeField::zero()
};

for i in (0..layer_num).rev() {
Expand Down
1 change: 1 addition & 0 deletions src/verifier/sumcheck_verifier_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ impl<C: GKRConfig> VerifierScratchPad<C> {
pub struct GKRVerifierHelper {}

impl GKRVerifierHelper {
#[allow(clippy::too_many_arguments)]
#[inline(always)]
pub fn prepare_layer<C: GKRConfig>(
layer: &CircuitLayer<C>,
Expand Down

0 comments on commit 7a50da5

Please sign in to comment.