Thank you, Dirk. For sure I will follow your advice, and I will try /
experiment. From your comment, I will probably try RcppArrayFire first,
rather than RcppParallel.

In relation to doing "CPU x GPU": what would happen if I have 3 variables
to be parallelized (independent from each other, no interdependencies) and
then I create an R function, using RcppArrayFire, to GPU-parallelize two of
them. Then, I use foreach (or similar) in R to CPU-paralellize the third
one (and for each variable of the third one, the R function is called, and
then internally, RcppArrayFire uses GPUs).

Would this scheme work? Or is there anything that blocks the combination of
CPU and GPU, even when CPU and GPU calculations are encapsulated and they
"do not see each other"?

Jordi Molins i Coronado
+34 69 38 000 59


On Sat, Sep 22, 2018 at 5:34 PM Dirk Eddelbuettel <e...@debian.org> wrote:

>
> Jordi,
>
> RcppParallel uses _thread_ parallelism on the CPU. RcppArrayFire can use
> that
> too, but can also use two GPU related mechanisms.  But those do not give
> you
> extra CPUs, so in short you cannot do "CPU x GPU".
>
> None of this is Rcpp specific.  But the respective articles on the
> RcppGallery are very good.  Try by replicating their results.  Then
> experiment.
>
> Just keep reading, and trying / experimenting.  A lot of this is best
> learned
> by trial and error, along with background reading.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to