Skip to content

Commit

Permalink
fix: correct warning for GPU explorations code
Browse files Browse the repository at this point in the history
  • Loading branch information
moven0831 committed Jun 6, 2024
1 parent 8eed163 commit bf0ae37
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
11 changes: 5 additions & 6 deletions mopro-core/src/middleware/gpu_explorations/arkworks_pippenger.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use ark_bn254::{Fr as ScalarField, G1Affine as GAffine, G1Projective as G};
use ark_ec::{AffineRepr, VariableBaseMSM};
use ark_ff::BigInt;
use ark_serialize::CanonicalDeserialize;
use ark_bn254::{Fr as ScalarField, G1Projective as G};
use ark_ec::VariableBaseMSM;
use std::time::{Duration, Instant};

use crate::middleware::gpu_explorations::utils::{benchmark::BenchmarkResult, preprocess};
Expand Down Expand Up @@ -135,7 +133,7 @@ mod tests {
"arkworks_pippenger"
);
let mut output_file = File::create(output_path).expect("output file creation failed");
writeln!(output_file, "msm_size,num_msm,avg_processing_time(ms)");
writeln!(output_file, "msm_size,num_msm,avg_processing_time(ms)").unwrap();

let instance_size = vec![8, 12, 16, 18, 20, 22];
let num_instance = vec![10];
Expand All @@ -154,7 +152,8 @@ mod tests {
output_file,
"{},{},{}",
result.instance_size, result.num_instance, result.avg_processing_time
);
)
.unwrap();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ark_bn254::{Fq, FqConfig};
use ark_bn254::Fq;
use ark_ff::biginteger::{BigInteger, BigInteger256};

use crate::middleware::gpu_explorations::metal::abstraction::mont_reduction;
Expand Down
13 changes: 5 additions & 8 deletions mopro-core/src/middleware/gpu_explorations/metal/msm.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
use ark_bn254::{Fq, Fr as ScalarField, G1Affine as GAffine, G1Projective as G};
use ark_ec::{AffineRepr, CurveGroup, Group, VariableBaseMSM};
use ark_ff::{
biginteger::{BigInteger, BigInteger256},
PrimeField, UniformRand,
};
use ark_ec::{AffineRepr, Group, VariableBaseMSM};
use ark_ff::PrimeField;
use ark_std::{cfg_into_iter, vec::Vec, One, Zero};

// For benchmarking
use ark_serialize::CanonicalDeserialize;
use std::time::{Duration, Instant};

use crate::middleware::gpu_explorations::metal::abstraction::{
Expand Down Expand Up @@ -336,7 +332,7 @@ mod tests {
"metal_msm"
);
let mut output_file = File::create(output_path).expect("output file creation failed");
writeln!(output_file, "msm_size,num_msm,avg_processing_time(ms)");
writeln!(output_file, "msm_size,num_msm,avg_processing_time(ms)").unwrap();

let instance_size = vec![8, 12, 16, 18, 20, 22];
let num_instance = vec![10];
Expand All @@ -355,7 +351,8 @@ mod tests {
output_file,
"{},{},{}",
result.instance_size, result.num_instance, result.avg_processing_time
);
)
.unwrap();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ mod tests {
};

use ark_bn254::{Fq, G1Projective as G};
use ark_ff::{
biginteger::{BigInteger, BigInteger256},
BigInt, Field, PrimeField,
};
use ark_ff::{BigInt, Field};
use ark_std::Zero;

use metal::MTLSize;
Expand Down Expand Up @@ -342,7 +339,7 @@ mod tests {
}

prop_compose! {
fn rand_point()(n in any::<u8>()) -> G {
fn rand_point()(_n in any::<u8>()) -> G {
let rng = &mut thread_rng();
G::rand(rng)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use ark_bn254::{Fr as ScalarField, G1Affine as GAffine, G1Projective as G};
use ark_ff::{Field, PrimeField};
use ark_bn254::{Fr as ScalarField, G1Affine as GAffine};
use ark_ff::PrimeField;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, SerializationError};
use ark_std::{
rand::{Rng, RngCore},
UniformRand,
};
use ark_std::{rand::RngCore, UniformRand};
use std::collections::VecDeque;
use std::fs::File;
use thiserror::Error;
Expand Down

0 comments on commit bf0ae37

Please sign in to comment.