Book Image

R High Performance Programming

Book Image

R High Performance Programming

Overview of this book

Table of Contents (17 chapters)
R High Performance Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

R and GPUs


The R community has developed a few packages for R programmers to leverage GPUs. The vectorized nature of R makes the use of GPUs a natural fit. The packages vary in the level of encapsulation and hence the required familiarity with the native CUDA or OpenCL languages. A selection of R packages for GPU programming are listed here:

  • gputools: This provides R functions that wrap around GPU-based algorithms for common operations, such as linear models and matrix algebra. It requires CUDA, and hence an NVIDIA GPU.

  • gmatrix: This provides the gmatrix and gvector classes to represent matrices and vectors respectively in NVIDIA GPUs. It also provides functions for common matrix operations such as matrix algebra, and random number generation and sorting.

  • RCUDA: This provides a low-level interface to load and call a CUDA kernel from an R session. Using RCUDA requires a good understanding of the CUDA language, but allows more flexibility and code optimization. More information about t can be...