Skip to content

Commit

Permalink
fix: gate parallelism on cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Feb 13, 2024
1 parent 4ae3a57 commit 0fafb78
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/spartan/batched_ppsnark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> BatchedRelaxedR1CSSNARKTrait<E>
let comms_Az_Bz_Cz = polys_Az_Bz_Cz
.par_iter()
.map(|[Az, Bz, Cz]| {
#[cfg(features = "cuda")]
{
let comm_Az = E::CE::commit(ck, Az);
let comm_Bz = E::CE::commit(ck, Bz);
let comm_Cz = E::CE::commit(ck, Cz);
}
#[cfg(not(features = "cuda"))]
let (comm_Az, (comm_Bz, comm_Cz)) = rayon::join(
|| E::CE::commit(ck, Az),
|| rayon::join(|| E::CE::commit(ck, Bz), || E::CE::commit(ck, Cz)),
Expand Down

0 comments on commit 0fafb78

Please sign in to comment.