Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev-tranpose' into dev-tranpose
Browse files Browse the repository at this point in the history
  • Loading branch information
cliff0412 committed Mar 20, 2024
2 parents 5b33837 + e3fc330 commit e73e66b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ pgo-data.profdata
docs/**bench**

**/*/libposeidon-permute-c-mac.a
**/*/go-iden3-crypto/
**/*/go-iden3-crypto/
.vscode
2 changes: 1 addition & 1 deletion field/examples/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() {
let domain_size = 1usize << 10;

let v: Vec<u64> = (0..domain_size).map(|_| random_fr()).collect();
let mut buffer = v.clone();
let buffer = v.clone();

let coeffs = buffer
.iter()
Expand Down
2 changes: 1 addition & 1 deletion field/src/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::vec::Vec;
use core::cmp::{max, min};

#[cfg(feature = "cuda")]
use cryptography_cuda::{intt, ntt, types::NTTInputOutputOrder};
use cryptography_cuda::{ntt, types::NTTInputOutputOrder};
use plonky2_util::{log2_strict, reverse_index_bits_in_place};
use unroll::unroll_for_loops;

Expand Down
2 changes: 1 addition & 1 deletion field/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ lazy_static! {

#[cfg(test)]
mod test {
use super::*;


#[cfg(feature = "precompile")]
#[test]
Expand Down
19 changes: 9 additions & 10 deletions plonky2/src/fri/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use alloc::vec::Vec;

#[cfg(feature = "cuda")]
use cryptography_cuda::{
device::memory::HostOrDeviceSlice, device::stream::CudaStream, intt_batch, lde_batch_multi_gpu,
ntt_batch, transpose_rev_batch, types::*,
device::memory::HostOrDeviceSlice, lde_batch_multi_gpu, transpose_rev_batch, types::*,
};
use itertools::Itertools;
use plonky2_field::types::Field;
Expand Down Expand Up @@ -145,7 +144,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
let log_n = log2_strict(degree);

#[cfg(feature = "cuda")]
if(log_n + rate_bits > 10 && polynomials.len() > 0){
if log_n + rate_bits > 10 && polynomials.len() > 0 {
let lde_values = Self::from_coeffs_gpu(
&polynomials,
rate_bits,
Expand All @@ -157,7 +156,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
degree
);

let num_gpus: usize = std::env::var("NUM_OF_GPUS")
let _num_gpus: usize = std::env::var("NUM_OF_GPUS")
.expect("NUM_OF_GPUS should be set")
.parse()
.unwrap();
Expand Down Expand Up @@ -205,15 +204,15 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
polynomials: &[PolynomialCoeffs<F>],
rate_bits: usize,
blinding: bool,
cap_height: usize,
timing: &mut TimingTree,
fft_root_table: Option<&FftRootTable<F>>,
_cap_height: usize,
_timing: &mut TimingTree,
_fft_root_table: Option<&FftRootTable<F>>,
log_n: usize,
degree: usize
_degree: usize
)-> Vec<Vec<F>>{
// If blinding, salt with two random elements to each leaf vector.

use plonky2_field::polynomial;

let salt_size = if blinding { SALT_SIZE } else { 0 };
println!("salt_size: {:?}", salt_size);
let output_domain_size = log_n + rate_bits;
Expand Down Expand Up @@ -293,7 +292,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
let nums: Vec<usize> = (0..(1<< output_domain_size)).collect();
let r = nums
.par_iter()
.map(|i| {
.map(|_i| {
let mut host_data: Vec<F> = vec![F::ZERO; total_num_of_fft];
device_transpose_data.copy_to_host_offset(
host_data.as_mut_slice(),
Expand Down
2 changes: 1 addition & 1 deletion plonky2/tests/factorial_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::Result;

use plonky2::field::types::Field;
use plonky2::iop::witness::{PartialWitness, WitnessWrite};
use plonky2::plonk::circuit_builder::CircuitBuilder;
Expand Down
2 changes: 1 addition & 1 deletion plonky2/tests/range_check_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::Result;

use plonky2::field::types::Field;
use plonky2::iop::witness::{PartialWitness, WitnessWrite};
use plonky2::plonk::circuit_builder::CircuitBuilder;
Expand Down
2 changes: 1 addition & 1 deletion plonky2/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub fn init_cuda() {
use plonky2_field::types::PrimeField64;

use cryptography_cuda::{
get_number_of_gpus_rs, init_twiddle_factors_rs, init_coset_rs, ntt, ntt_batch, types::NTTInputOutputOrder,
get_number_of_gpus_rs, init_twiddle_factors_rs, init_coset_rs,
};

let num_of_gpus = get_number_of_gpus_rs();
Expand Down

0 comments on commit e73e66b

Please sign in to comment.