GPU Functions for R Objects

Provides GPU enabled functions for R objects in a simple and approachable manner. New gpu* and vcl* classes have been provided to wrap typical R objects (e.g. vector, matrix), in both host and device spaces, to mirror typical R syntax without the need to know OpenCL.


Gitter rooms available for discussion

chat general development testing

Build Status

Build Dev
Linux x86_64 Build Status Build Status
OSX Build Status Build Status
Windows x86 Appveyor Build Status Appveyor Build Status

Test coverage: Coverage Status

Community Use: Downloads

Welcome to my R package for simple GPU computing. Although there are a few existing packages to leverage the power of GPU's they are either specific to one brand (e.g. NVIDIA) or are not very user friendly. The goal of this package is to provide the user a very simple R API that can be used with any GPU (via an OpenCL backend). This is accomplished by interfacing with the ViennaCL library that I have packaged in the R package RViennaCL. To make the R API simple, I created new classes similar to the structure of the Matrix package. By doing so, typical methods may be overloaded to make for a very pleasing sytax. For example, to perform vector addition the syntax is:

A <-, to=999)
B <-, to=1)
gpuA <- gpuVector(A)
gpuB <- gpuVector(B)
C <- A + B
gpuC <- gpuA + gpuB
all(C == gpuC)
[1] TRUE

I also recommend you read the vignette I included with this package to get a better understanding of its' capabilities.


Please note, all the functions herein use an OpenCL backend. If you prefer to have a CUDA based backend, please see my other package gpuRcuda which is simply an extension on top of this package where all functions herein are still applicable but also have the CUDA option available.


Please see my github wiki for installation instructions relevant to your operating system.

Things to Do

  1. Obviously more vector functions and matrix implementations
  2. My resources limit how much I can test (e.g. OS, GPU vendors). Would appreciate any feedback on how the installation and use fairs with other platforms and GPUs.
  3. Would love any suggestions :) (submit in the issues)


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.0.3 by Charles Determan Jr., a year ago

Report a bug at

Browse source code at

Authors: Charles Determan Jr.

Documentation:   PDF Manual  

Task views:

GPL (>= 2) license

Imports Rcpp, assertive

Depends on methods, utils

Suggests testthat, knitr

Linking to Rcpp, RcppEigen, RViennaCL, BH

System requirements: C++11 (supporting at least std=c++0x), OpenCL shared library (provided by an SDK such as AMD/NVIDIA) and OpenCL headers including the C++ header file (provided by Khronos if not by SDK)

Suggested by RViennaCL.

See at CRAN