Skip to content

Commit

Permalink
use new api
Browse files Browse the repository at this point in the history
Signed-off-by: GopherJ <[email protected]>
  • Loading branch information
GopherJ committed Oct 10, 2024
1 parent a647e51 commit a116707
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ async-trait = { version = "0.1", optional = true }
elsa = { version = "1.9" }

[target.'cfg(all(target_arch = "aarch64", target_os = "macos"))'.dependencies]
miden-gpu = { git = "https://github.com/0xPolygonMiden/miden-gpu", rev = "834c7973893bf6d6a93f4035de4fbf6faadc9c1d", default-features = false, optional = true }
miden-gpu = { git = "https://github.com/0xPolygonMiden/miden-gpu", rev = "389dd1ed47b9b345e978611421afa2eab722e9c4", default-features = false, optional = true }
pollster = { version = "0.3", optional = true }

[target.'cfg(target_family = "wasm")'.dependencies]
miden-gpu = { git = "https://github.com/0xPolygonMiden/miden-gpu", rev = "834c7973893bf6d6a93f4035de4fbf6faadc9c1d", default-features = false, optional = true }
miden-gpu = { git = "https://github.com/0xPolygonMiden/miden-gpu", rev = "389dd1ed47b9b345e978611421afa2eab722e9c4", default-features = false, optional = true }

[target.'cfg(target_family = "wasm")'.dev-dependencies]
wasm-bindgen-test = "0.3"
Expand Down
18 changes: 9 additions & 9 deletions prover/src/gpu/webgpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use air::{AuxRandElements, LagrangeKernelEvaluationFrame};
use elsa::FrozenVec;
use maybe_async::maybe_async;
use miden_gpu::{
webgpu::{build_merkle_tree, get_or_init_wgpu_helper, RowHasher},
webgpu::{get_or_init_wgpu_helper, RowHasher},
HashFn,
};
use processor::{
Expand Down Expand Up @@ -274,14 +274,14 @@ where
} else {
segment.iter().map(|x| *x).collect()
};
row_hasher.update(helper, &rpo_padded_segment);
row_hasher.update(&rpo_padded_segment);
assert_eq!(segments.len() - 1, segment_idx, "padded segment should be the last");
break;
}
row_hasher.update(helper, segment);
row_hasher.update(segment);
}
let row_hashes = row_hasher.finish(helper).await.unwrap();
let tree_nodes = build_merkle_tree(helper, &row_hashes, self.webgpu_hash_fn).await.unwrap();
let row_hashes = row_hasher.finish().await;
let tree_nodes = helper.build_merkle_tree(&row_hashes, self.webgpu_hash_fn).await;
// aggregate segments at the same time as the GPU generates the merkle tree nodes
let composed_evaluations = RowMatrix::<E>::from_segments(segments, num_base_columns);
let nodes = tree_nodes.into_iter().map(|dig| H::Digest::from(&dig)).collect();
Expand Down Expand Up @@ -640,14 +640,14 @@ async fn build_trace_commitment<
} else {
segment.iter().map(|x| *x).collect()
};
row_hasher.update(&helper, &rpo_padded_segment);
row_hasher.update(&rpo_padded_segment);
assert!(lde_segment_iter.next().is_none(), "padded segment should be the last");
break;
}
row_hasher.update(&helper, segment);
row_hasher.update(segment);
}
let row_hashes = row_hasher.finish(&helper).await.unwrap();
let tree_nodes = build_merkle_tree(&helper, &row_hashes, hash_fn).await.unwrap();
let row_hashes = row_hasher.finish().await;
let tree_nodes = helper.build_merkle_tree(&row_hashes, hash_fn).await;
// aggregate segments at the same time as the GPU generates the merkle tree nodes
let lde_segments = lde_segments.into_vec().into_iter().map(|p| *p).collect();
let trace_lde = RowMatrix::from_segments(lde_segments, num_base_columns);
Expand Down

0 comments on commit a116707

Please sign in to comment.