-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restoring no_std compliance #85
Conversation
Some major changes in 8056f95 (this commit require more eyes and knowledge cc @chancharles92); After fd5819b, the only problematic dependency is
Based on @nyospe's comment:
I believe we have clear out all non- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to find a way to make the parallel/not(parallel) per_iter/iter branches inline, so that we don't have potentially diverging duplicate code, but otherwise, this looks great.
completely agree! I haven't figured a way yet, but I will try a few things tmr. |
I come up with 04a6f06, it should be much cleaner now @nyospe: /// 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();
///
/// // 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()
} cc @chancharles92, @zhenfeizhang this commit could need acknowledgement. |
🎆 |
* 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
I come across another (even more comprehensive) solution: This is more complete than and basically the generalization of my |
Nice. |
Description
Major changes include:
std
componentsdefault-features = false
) on arkworkshashbrown
's HashSet, HashMaprayon
accelerated code toparallel
feature flag which is on by defaultcloses: #84
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Targeted PR against correct branch (main)Wrote unit testsUpdated relevant documentation in the codePending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer