forked from M-Labs/nalgebra
Use rayon as the feature name instead of par-iter
This commit is contained in:
parent
82b4960740
commit
3a8c1bf81e
2
.github/workflows/nalgebra-ci-build.yml
vendored
2
.github/workflows/nalgebra-ci-build.yml
vendored
@ -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:
|
||||
|
@ -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" ]
|
||||
|
@ -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")]
|
||||
|
@ -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<T, R, Cols>> {
|
||||
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
|
||||
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<T, R, Cols>> 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<T, R, Cols, S>,
|
||||
}
|
||||
|
||||
#[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<T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> Matrix<T, R, Cols, S>
|
||||
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<T, R, C>>(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<T, R, Cols>> Producer
|
||||
for ColumnProducer<'a, T, R, Cols, S>
|
||||
where
|
||||
|
@ -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::<f32>::zeros(400, 300);
|
||||
|
Loading…
Reference in New Issue
Block a user