I am working on a parallel matrix multiplication code in Rust, where I want to compute every element of the product in parallel. I use ndarray
s to store my data. Thus, my code would be something alone the lines
fn mul(lhs: &Array2<f32>, rhs: &Array2<f32>) -> Array2<f32> {
let N = lhs.raw_size()[0];
let M = rhs.raw_size()[1];
let mut result = Array2::zeros((N,M));
range_2d(0..N,0..M).par_iter().map(|(i, j)| {
// load the result for the (i,j) element into 'result'
}).count();
result
}
Is there any way to achieve this?