Ndarray parallel with rayon problem

Hi All,

I'm trying to do some parallel stuff with ndarray (0.13.1) which is supposed to be integrated with rayon (1.3.0) but when I do this:

use ndarray::{Array2, Array1};
use ndarray::parallel::prelude::*;

I get this error:

error[E0433]: failed to resolve: could not find parallel in ndarray
--> src/utils.rs:4:18
|
4 | use ndarray::parallel::prelude::*;
| ^^^^^^^^ could not find parallel in ndarray

error: aborting due to previous error

I've tried kind of all obvious things (cleaning, recompiling, etc.) but nothing works.

My Cargo.toml file looks like:

[dependencies]
ndarray = "0.13.1"
rand = "0.7.3"
rand_distr = "0.2.2"
num-traits = "0.2"
rayon = "1.3.0"

Any help would be really appreciated!

1 Like

You need to enable the rayon feature.

[dependencies]
ndarray = { version = "0.13.1", features = ["rayon"] }
1 Like

Thanks Alice! Now it runs smoothly ...

btw, please put errors and your toml into code blocks in the future

Ok! ... :+1:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.