Use rayon as the feature name instead of par-iter

This commit is contained in:
Sébastien Crozet 2023-01-14 15:59:11 +01:00
parent 82b4960740
commit 3a8c1bf81e
5 changed files with 23 additions and 23 deletions

View File

@ -61,7 +61,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: test - 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: test-nalgebra-glm:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -33,7 +33,7 @@ libm = [ "simba/libm" ]
libm-force = [ "simba/libm_force" ] libm-force = [ "simba/libm_force" ]
macros = [ "nalgebra-macros" ] macros = [ "nalgebra-macros" ]
cuda = [ "cust_core", "simba/cuda" ] cuda = [ "cust_core", "simba/cuda" ]
par-iter = [ "std", "rayon" ]
# Conversion # Conversion
convert-mint = [ "mint" ] convert-mint = [ "mint" ]

View File

@ -42,7 +42,7 @@ mod min_max;
/// Mechanisms for working with values that may not be initialized. /// Mechanisms for working with values that may not be initialized.
pub mod uninit; pub mod uninit;
#[cfg(feature = "par-iter")] #[cfg(feature = "rayon")]
pub mod par_iter; pub mod par_iter;
#[cfg(feature = "rkyv-serialize-no-std")] #[cfg(feature = "rkyv-serialize-no-std")]

View File

@ -14,10 +14,10 @@ use rayon::{iter::plumbing::bridge, prelude::*};
/// A rayon parallel iterator over the colums of a matrix. It is created /// A rayon parallel iterator over the colums of a matrix. It is created
/// using the [`par_column_iter`] method of [`Matrix`]. /// 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 /// [`par_column_iter`]: crate::Matrix::par_column_iter
/// [`Matrix`]: crate::Matrix /// [`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<T, R, Cols>> { pub struct ParColumnIter<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> {
mat: &'a Matrix<T, R, Cols, S>, mat: &'a Matrix<T, R, Cols, S>,
} }
@ -29,7 +29,7 @@ impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> 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<T, R, Cols>> ParallelIterator impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> ParallelIterator
for ParColumnIter<'a, T, R, Cols, S> for ParColumnIter<'a, T, R, Cols, S>
where where
@ -50,8 +50,8 @@ where
} }
} }
#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))]
/// *Only available if compiled with the feature `par-iter`.* /// *Only available if compiled with the feature `rayon`.*
impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> IndexedParallelIterator impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> IndexedParallelIterator
for ParColumnIter<'a, T, R, Cols, S> for ParColumnIter<'a, T, R, Cols, S>
where 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. /// 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< pub struct ParColumnIterMut<
'a, 'a,
T, T,
@ -88,8 +88,8 @@ pub struct ParColumnIterMut<
mat: &'a mut Matrix<T, R, Cols, S>, mat: &'a mut Matrix<T, R, Cols, S>,
} }
#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))]
/// *only availabe if compiled with the feature `par-iter`* /// *only availabe if compiled with the feature `rayon`*
impl<'a, T, R, Cols, S> ParColumnIterMut<'a, T, R, Cols, S> impl<'a, T, R, Cols, S> ParColumnIterMut<'a, T, R, Cols, S>
where where
R: Dim, R: Dim,
@ -102,8 +102,8 @@ where
} }
} }
#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))]
/// *Only available if compiled with the feature `par-iter`* /// *Only available if compiled with the feature `rayon`*
impl<'a, T, R, Cols, S> ParallelIterator for ParColumnIterMut<'a, T, R, Cols, S> impl<'a, T, R, Cols, S> ParallelIterator for ParColumnIterMut<'a, T, R, Cols, S>
where where
R: Dim, R: Dim,
@ -125,8 +125,8 @@ where
} }
} }
#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))]
/// *Only available if compiled with the feature `par-iter`* /// *Only available if compiled with the feature `rayon`*
impl<'a, T, R, Cols, S> IndexedParallelIterator for ParColumnIterMut<'a, T, R, Cols, S> impl<'a, T, R, Cols, S> IndexedParallelIterator for ParColumnIterMut<'a, T, R, Cols, S>
where where
R: Dim, 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` /// # Parallel iterators using `rayon`
/// *Only available if compiled with the feature `par-iter`* /// *Only available if compiled with the feature `rayon`*
impl<T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> Matrix<T, R, Cols, S> impl<T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> Matrix<T, R, Cols, S>
where where
T: Send + Sync + Scalar, T: Send + Sync + Scalar,
@ -225,8 +225,8 @@ where
/// rayon trait part of the public interface of the `ColumnIter`. /// rayon trait part of the public interface of the `ColumnIter`.
struct ColumnProducer<'a, T, R: Dim, C: Dim, S: RawStorage<T, R, C>>(ColumnIter<'a, T, R, C, S>); struct ColumnProducer<'a, T, R: Dim, C: Dim, S: RawStorage<T, R, C>>(ColumnIter<'a, T, R, C, S>);
#[cfg_attr(doc_cfg, doc(cfg(feature = "par-iter")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "rayon")))]
/// *only available if compiled with the feature `par-iter`* /// *only available if compiled with the feature `rayon`*
impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> Producer impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> Producer
for ColumnProducer<'a, T, R, Cols, S> for ColumnProducer<'a, T, R, Cols, S>
where where

View File

@ -1218,7 +1218,7 @@ fn column_iterator_double_ended_mut() {
} }
#[test] #[test]
#[cfg(feature = "par-iter")] #[cfg(feature = "rayon")]
fn parallel_column_iteration() { fn parallel_column_iteration() {
use nalgebra::dmatrix; use nalgebra::dmatrix;
use rayon::prelude::*; use rayon::prelude::*;
@ -1251,7 +1251,7 @@ fn parallel_column_iteration() {
} }
#[test] #[test]
#[cfg(feature = "par-iter")] #[cfg(feature = "rayon")]
fn column_iteration_mut_double_ended() { fn column_iteration_mut_double_ended() {
let dmat = nalgebra::dmatrix![ let dmat = nalgebra::dmatrix![
13,14,15,16,17; 13,14,15,16,17;
@ -1270,7 +1270,7 @@ fn column_iteration_mut_double_ended() {
} }
#[test] #[test]
#[cfg(feature = "par-iter")] #[cfg(feature = "rayon")]
fn parallel_column_iteration_mut() { fn parallel_column_iteration_mut() {
use rayon::prelude::*; use rayon::prelude::*;
let mut first = DMatrix::<f32>::zeros(400, 300); let mut first = DMatrix::<f32>::zeros(400, 300);