RCUDA - Bindings for R to the CUDA API

RCUDA_0.4-0.tar.gz

RCUDA on github

Paul Baines
Duncan Temple Lang

This R package is an interface to the CUDA API and libraries. It allows R programmers to invoke code on a Nvidia (GP)GPU. This gives extensive parallelism on ALUs.

This package is similar to Simon Urbanek's OpenCL package, but specifically targets CUDA and Nvidia. These packages provide the building blocks for people to use the GPUs from within R in arbitrary ways. They allow one to write code in R that manipulates the GPU. This is different from packages such as gputools or rgpu which provide R functions for particular algorithms which are programmed in C and leverage the GPU through that C code. OpenCL and RCUDA aim to make writing that code feasible in R. This is allows us to use higher-level programming languages and also makes it much easier to experiment with GPUs. This leads to more flexible code and much less of it.

Current Status

We have programmatically generated bindings to almost all of the routines in the CUDA SDK API and to the enumerated constants and non-opaque data structures.

We have also managed to translate/compile a very simple kernel written in R code to PTX code and load and invoke that with RCUDA. The compilation is done in R using the Rllvm and RLLVMCompile packages. (See the development versions on github at present)

We have also developed an interface to libNVVM for converting LLVM Intermediate Representation (IR) code to PTX. This gives us two ways to generate the PTX from R code.

Examples

  • normal density
    This avoids excess memory by writing the results into the same vector as the inputs.
  • normal density
    This uses a separate input and output vector.
  • grid.R
    Exploring using different geometries or dimensions for the grid and blocks.
  • brief user's guide in development.
  • Examples in tests/
  • Complete collection of examples in explorations/
  • Draft of a paper describing RCUDA
  • Compiling R code to PTX with Rllvm, RLLVMCompile and optionally Rnvvm

  • Duncan Temple Lang <dtemplelang@ucdavis.edu>
    Last modified: Thu Jul 18 07:39:32 PDT 2013