Learn R Programming

gpuR

Gitter rooms available for discussion

Build Status

BuildDev
Linux x86_64
OSX
Windows x86

Test coverage:

Community Use:

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 <- seq.int(from=0, to=999)
B <- seq.int(from=1000, 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.

vignette("gpuR")

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.

INSTALL

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. 2. Would love any suggestions :) (submit in the issues)

Copy Link

Version

Install

install.packages('gpuR')

Monthly Downloads

2,980

Version

2.0.6

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

May 23rd, 2024

Functions in gpuR (2.0.6)

cvclMatrix-class

cvclMatrix Class
dgpuVector-class

dgpuVector Class
detectGPUs

Detect Available GPUs
distance

GPU Distance Matrix Computations
dgpuMatrix-class

dgpuMatrix Class
fgpuMatrix-class

fgpuMatrix Class
[,gpuMatrix,missing,missing,missing-method

Extract gpuR object elements
dvclMatrix-class

dvclMatrix Class
det,vclMatrix-method

Calculate Determinant of a Matrix on GPU
gpuInfo

Device Information
deviceType

Check device type
fvclVector-class

fvclVector Class
gpuMatrix-class

gpuMatrix Class
slice

Vector Slices
crossprod,gpuMatrix,missing-method

gpuMatrix Crossproduct
gpuVector

Construct a gpuVector
gpuVector-class

gpuVector Class
detectPlatforms

Detect Number of Platforms
deviceHasDouble

Check GPU double precision support
gpuMatrix

Construct a gpuMatrix
ivclMatrix-class

ivclMatrix Class
ivclVector-class

ivclVector Class
colSums,gpuMatrix-method

Row and Column Sums and Means of gpuMatrix
log,gpuVector-method

gpuR Logarithms and Exponentials
block

Matrix Blocks
deepcopy

Copy a "gpuR" object
length,gpuVector-method

gpuMatrix/vclMatrix length method
listContexts

Available OpenCL Contexts
gpuR-package

GPU functions for R Objects
has_multiple_gpu_skip

Skip test in less than 2 GPUs
pocl_check

POCL Version Check
has_multiple_double_skip

Skip test for multiple GPUs with double precision
eigen,gpuMatrix-method

gpuMatrix Eigen Decomposition
dim,vclMatrix-method

gpuMatrix/vclMatrix dim method
dvclVector-class

dvclVector Class
cov,vclMatrix,missing,missing,missing-method

Covariance (gpuR)
diag,vclMatrix-method

gpuR Matrix Diagonals
norm,vclMatrix,character-method

Compute the Norm of a Matrix
svd

Singular Value Decomposition of a gpuR matrix
vclMatrix

Construct a vclMatrix
synchronize

Synchronize Device Execution
setup_opencl

Setup OpenCL Arguments
%o%,gpuVector,gpuVector-method

Outer Product
colSums,vclMatrix-method

Row and Column Sums and Means of vclMatrix
vclVector

Construct a vclVector
igpuMatrix-class

igpuMatrix Class
vclVector-class

vclVector Class
nrow,vclMatrix-method

The Number of Rows/Columns of a gpuR matrix
solve,vclMatrix,vclMatrix-method

Solve a System of Equations for gpuR objects
identity_matrix

Identity Matrix on Device
has_gpu_skip

Skip test for GPUs
has_double_skip

Skip test for GPU double precision
t,vclMatrix-method

gpuR matrix transpose
pmax

Parallel Maxima and Minima
typeof,gpuMatrix-method

Get gpuR object type
platformInfo

OpenCL Platform Information
qr.R,gpuQR-method

Reconstruct the Q or R Matrices from a gpuQR Object
qr.gpuMatrix

The QR Decomposition of a gpuR matrix
print.gpuMatrix

S3 print for gpuMatrix objects
permute

Permuting functions for gpuR objects
zgpuMatrix-class

zgpuMatrix Class
fgpuVector-class

fgpuVector Class
%*%,gpuVector,gpuVector-method

Methods for gpu/vcl Vector
has_cpu_skip

Skip test for CPUs
fvclMatrix-class

fvclMatrix Class
igpuVector-class

igpuVector Class
zvclMatrix-class

zvclMatrix Class
vclMatrix-class

vclMatrix Class
inplace

Inplace Function Wrapper
tcrossprod,gpuVector,gpuVector-method

vclMatrix Crossproduct
set_device_context

Set Context for Specific Device Type
setContext

Set Context
assert_has_double

Does device have 'double' support?
as.gpuVector

Convert object to a gpuVector
as.gpuMatrix

Convert object to a gpuMatrix
Arith,gpuVector,gpuVector-method

Arith methods
as.vclVector

Convert object to a vclVector
Summary,gpuVector-method

gpuR Summary methods
chol.vclMatrix

Cholesky Decomposition of a gpuR matrix
Compare,vector,gpuVector-method

Compare vector and gpuVector elements
Math,gpuVector-method

gpuR Math methods
cgpuMatrix-class

cgpuMatrix Class
detectCPUs

Detect Available OpenCL enabled CPUs
currentDevice

Current Device Information
currentContext

Current Context
colnames

Row and Column Names
currentPlatform

Return Current Platform
custom_opencl

Custom OpenCL Kernels