Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
doutv committed Oct 28, 2024
1 parent a8a580d commit e55bc6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
11 changes: 4 additions & 7 deletions wrappers/rust/benches/lde_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use std::env;

use criterion::{criterion_group, criterion_main, Criterion};
use cryptography_cuda::{
device::memory::HostOrDeviceSlice, get_number_of_gpus_rs, init_coset_rs, init_twiddle_factors_rs, lde_batch_multi_gpu, types::NTTConfig
device::memory::HostOrDeviceSlice, get_number_of_gpus_rs, init_coset_rs,
init_twiddle_factors_rs, lde_batch_multi_gpu, types::NTTConfig,
};
use plonky2_field::{
goldilocks_field::GoldilocksField,
Expand Down Expand Up @@ -76,8 +77,7 @@ fn bench_multi_gpu_lde_batch(c: &mut Criterion) {
group.sample_size(10).bench_function(
&format!(
"Multi gpu lde on {} GPUs with lg_n size of 2^{}",
ngpus,
log_n_sizes
ngpus, log_n_sizes
),
|b| {
b.iter(|| {
Expand All @@ -95,10 +95,7 @@ fn bench_multi_gpu_lde_batch(c: &mut Criterion) {
);

group.sample_size(10).bench_function(
&format!(
"Multi gpu lde on 1 GPU with lg_n size of 2^{}",
log_n_sizes
),
&format!("Multi gpu lde on 1 GPU with lg_n size of 2^{}", log_n_sizes),
|b| {
b.iter(|| {
lde_batch_multi_gpu(
Expand Down
2 changes: 1 addition & 1 deletion wrappers/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,4 @@ pub fn init_cuda_degree_rs(max_degree: usize) {
unsafe {
init_cuda_degree(max_degree);
}
}
}
12 changes: 6 additions & 6 deletions wrappers/rust/tests/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ use cryptography_cuda::{
};
use plonky2::{
hash::{
poseidon_bn128::PoseidonBN128GoldilocksConfig,
hash_types::{RichField, NUM_HASH_OUT_ELTS},
merkle_tree::MerkleTree
merkle_tree::MerkleTree,
poseidon_bn128::PoseidonBN128GoldilocksConfig,
},
plonk::config::{
GenericConfig, Hasher, HasherType, Poseidon2GoldilocksConfig,
PoseidonGoldilocksConfig,
GenericConfig, Hasher, HasherType, Poseidon2GoldilocksConfig, PoseidonGoldilocksConfig,
},
};
use plonky2_field::types::Field;
Expand Down Expand Up @@ -156,7 +155,8 @@ fn capacity_up_to_mut<T>(v: &mut Vec<T>, len: usize) -> &mut [MaybeUninit<T>] {
}

fn test_merkle_trees_consistency_with_plonky2<C>()
where C: GenericConfig<2>
where
C: GenericConfig<2>,
{
let leaves_count = 1 << 12; // number of leaves
let leaf_size = 7; // leaf size
Expand Down Expand Up @@ -216,4 +216,4 @@ fn test_merkle_trees_poseidon2_g64_consistency_with_plonky2() {
#[test]
fn test_merkle_trees_poseidon_bn128_consistency_with_plonky2() {
test_merkle_trees_consistency_with_plonky2::<PoseidonBN128GoldilocksConfig>();
}
}

0 comments on commit e55bc6f

Please sign in to comment.