0

I would like to pass an array in a parallel code with RcppParallel.

First, I can pass an array with arma::cube. Is an arma::cube variable thread safe in a parallel code?

Second, to make a NumericVector thread safe, we can convert it to RcppParallel::RVector<double>. To make a NumericMatrix thread safe, we can convert it to RcppParallel::RMatrix<double>. Is there a RcppParallel::RArray<double> equivalent for an arma::cube or another type of variable?

I am expecting a simple yes/no answers or short examples.

Emmanuel Hamel
  • 1,769
  • 7
  • 19
  • I’m voting to close this question because a simple look at the header file in question reveals there isn't such a data structure. So this question is, on balance, too close to 'write code for me please'. – Dirk Eddelbuettel Aug 27 '23 at 13:58
  • Hi, thank you for your comment! I did a research. On my end, I did not find anything. I wanted to be sure I did not miss anything. The solution I am using right now is to convert the arma::cube variable to a std::vector variable or a RcppParallel::RVector variable. I wanted to know if there was a better solution that avoids this kind of conversion. – Emmanuel Hamel Aug 28 '23 at 13:23

0 Answers0