[Rcpp-devel] Question on performance and strategy

Jordi Molins jordi.molins.coronado at gmail.com
Sat Sep 22 17:52:26 CEST 2018


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 <edd at 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 | edd at debian.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180922/8fdb2d46/attachment.html>


More information about the Rcpp-devel mailing list