-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no_std compliance and refactor SNARK trait (#87)
* update Snark -> UniversalSNARK trait (#80) * update Snark -> UniversalSNARK trait * enable CI on PR targetting cap-rollup branch * address Zhenfei's comment * Restoring no_std compliance (#85) * restore no_std on jf-* * remove HashMap and HashSet for no_std * fix bench.rs, add Display to TaggedBlobError * more no_std fix * put rayon to feature=parallel * use hashbrown for HashMap, update es-commons * simplify rayon-accelerated code * update CHANGELOG
- Loading branch information
Showing
28 changed files
with
509 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2022 Espresso Systems (espressosys.com) | ||
// This file is part of the Jellyfish library. | ||
// You should have received a copy of the MIT License | ||
// along with the Jellyfish library. If not, see <https://mit-license.org/>. | ||
|
||
//! Utilities for parallel code. | ||
/// this function helps with slice iterator creation that optionally use | ||
/// `par_iter()` when feature flag `parallel` is on. | ||
/// | ||
/// # Usage | ||
/// let v = [1, 2, 3, 4, 5]; | ||
/// let sum = parallelizable_slice_iter(&v).sum(); | ||
/// | ||
/// // the above code is a shorthand for (thus equivalent to) | ||
/// #[cfg(feature = "parallel")] | ||
/// let sum = v.par_iter().sum(); | ||
/// #[cfg(not(feature = "parallel"))] | ||
/// let sum = v.iter().sum(); | ||
#[cfg(feature = "parallel")] | ||
pub(crate) fn parallelizable_slice_iter<T: Sync>(data: &[T]) -> rayon::slice::Iter<T> { | ||
use rayon::iter::IntoParallelIterator; | ||
data.into_par_iter() | ||
} | ||
|
||
#[cfg(not(feature = "parallel"))] | ||
pub(crate) fn parallelizable_slice_iter<T>(data: &[T]) -> ark_std::slice::Iter<T> { | ||
use ark_std::iter::IntoIterator; | ||
data.iter() | ||
} |
Oops, something went wrong.