From 3a8c1bf81e56e37421f7f17cfeb5c48d69fe316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 14 Jan 2023 15:59:11 +0100 Subject: [PATCH] Use rayon as the feature name instead of par-iter --- .github/workflows/nalgebra-ci-build.yml | 2 +- Cargo.toml | 2 +- src/base/mod.rs | 2 +- src/base/par_iter.rs | 34 ++++++++++++------------- tests/core/matrix.rs | 6 ++--- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/nalgebra-ci-build.yml b/.github/workflows/nalgebra-ci-build.yml index 665bd008..d7027127 100644 --- a/.github/workflows/nalgebra-ci-build.yml +++ b/.github/workflows/nalgebra-ci-build.yml @@ -61,7 +61,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: test - run: cargo test --features arbitrary,rand,serde-serialize,sparse,debug,io,compare,libm,proptest-support,slow-tests,rkyv-safe-deser,par-iter; + run: cargo test --features arbitrary,rand,serde-serialize,sparse,debug,io,compare,libm,proptest-support,slow-tests,rkyv-safe-deser,rayon; test-nalgebra-glm: runs-on: ubuntu-latest steps: diff --git a/Cargo.toml b/Cargo.toml index e7c6ba1e..82528ed4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ libm = [ "simba/libm" ] libm-force = [ "simba/libm_force" ] macros = [ "nalgebra-macros" ] cuda = [ "cust_core", "simba/cuda" ] -par-iter = [ "std", "rayon" ] + # Conversion convert-mint = [ "mint" ] diff --git a/src/base/mod.rs b/src/base/mod.rs index 73fe18c3..0f09cc33 100644 --- a/src/base/mod.rs +++ b/src/base/mod.rs @@ -42,7 +42,7 @@ mod min_max; /// Mechanisms for working with values that may not be initialized. pub mod uninit; -#[cfg(feature = "par-iter")] +#[cfg(feature = "rayon")] pub mod par_iter; #[cfg(feature = "rkyv-serialize-no-std")] diff --git a/src/base/par_iter.rs b/src/base/par_iter.rs index 0f1202c9..af5e1cb7 100644 --- a/src/base/par_iter.rs +++ b/src/base/par_iter.rs @@ -14,10 +14,10 @@ use rayon::{iter::plumbing::bridge, prelude::*}; /// A rayon parallel iterator over the colums of a matrix. It is created /// using the [`par_column_iter`] method of [`Matrix`]. /// -/// *Only available if compiled with the feature `par-iter`.* +/// *Only available if compiled with the feature `rayon`.* /// [`par_column_iter`]: crate::Matrix::par_column_iter /// [`Matrix`]: crate::Matrix -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] pub struct ParColumnIter<'a, T, R: Dim, Cols: Dim, S: RawStorage> { mat: &'a Matrix, } @@ -29,7 +29,7 @@ impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> ParColumnIter<'a, T, R } } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> ParallelIterator for ParColumnIter<'a, T, R, Cols, S> where @@ -50,8 +50,8 @@ where } } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] -/// *Only available if compiled with the feature `par-iter`.* +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] +/// *Only available if compiled with the feature `rayon`.* impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> IndexedParallelIterator for ParColumnIter<'a, T, R, Cols, S> where @@ -75,9 +75,9 @@ where } } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] /// A rayon parallel iterator through the mutable columns of a matrix. -/// *Only available if compiled with the feature `par-iter`.* +/// *Only available if compiled with the feature `rayon`.* pub struct ParColumnIterMut< 'a, T, @@ -88,8 +88,8 @@ pub struct ParColumnIterMut< mat: &'a mut Matrix, } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] -/// *only availabe if compiled with the feature `par-iter`* +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] +/// *only availabe if compiled with the feature `rayon`* impl<'a, T, R, Cols, S> ParColumnIterMut<'a, T, R, Cols, S> where R: Dim, @@ -102,8 +102,8 @@ where } } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] -/// *Only available if compiled with the feature `par-iter`* +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] +/// *Only available if compiled with the feature `rayon`* impl<'a, T, R, Cols, S> ParallelIterator for ParColumnIterMut<'a, T, R, Cols, S> where R: Dim, @@ -125,8 +125,8 @@ where } } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] -/// *Only available if compiled with the feature `par-iter`* +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] +/// *Only available if compiled with the feature `rayon`* impl<'a, T, R, Cols, S> IndexedParallelIterator for ParColumnIterMut<'a, T, R, Cols, S> where R: Dim, @@ -152,9 +152,9 @@ where } } -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] /// # Parallel iterators using `rayon` -/// *Only available if compiled with the feature `par-iter`* +/// *Only available if compiled with the feature `rayon`* impl> Matrix where T: Send + Sync + Scalar, @@ -225,8 +225,8 @@ where /// rayon trait part of the public interface of the `ColumnIter`. struct ColumnProducer<'a, T, R: Dim, C: Dim, S: RawStorage>(ColumnIter<'a, T, R, C, S>); -#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] -/// *only available if compiled with the feature `par-iter`* +#[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))] +/// *only available if compiled with the feature `rayon`* impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> Producer for ColumnProducer<'a, T, R, Cols, S> where diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs index 41972347..27926a27 100644 --- a/tests/core/matrix.rs +++ b/tests/core/matrix.rs @@ -1218,7 +1218,7 @@ fn column_iterator_double_ended_mut() { } #[test] -#[cfg(feature = "par-iter")] +#[cfg(feature = "rayon")] fn parallel_column_iteration() { use nalgebra::dmatrix; use rayon::prelude::*; @@ -1251,7 +1251,7 @@ fn parallel_column_iteration() { } #[test] -#[cfg(feature = "par-iter")] +#[cfg(feature = "rayon")] fn column_iteration_mut_double_ended() { let dmat = nalgebra::dmatrix![ 13,14,15,16,17; @@ -1270,7 +1270,7 @@ fn column_iteration_mut_double_ended() { } #[test] -#[cfg(feature = "par-iter")] +#[cfg(feature = "rayon")] fn parallel_column_iteration_mut() { use rayon::prelude::*; let mut first = DMatrix::::zeros(400, 300);