This package implements a general framework for utilizing R to harness the power of NVIDIA GPU's. The "gmatrix" and "gvector" classes allow for easy management of the separate device and host memory spaces. Numerous numerical operations are implemented for these objects on the GPU. These operations include matrix multiplication, addition, subtraction, the kronecker product, the outer product, comparison operators, logical operators, trigonometric functions, indexing, sorting, random number generation and many more. The "gmatrix" package has only been tested and compiled for linux machines. It would certainly be nice of someone to get it working in Windows. Until then, Windows is not supported. In addition we assume that the divice is at least of NVIDIA(R) compute capibility 2.0, so this package may not work with older devices.
install.packages("gmatrix")
Alternatively, if you would like to install the developmental version, the following from the linux command line may be used:
git clone https://github.com/njm18/gmatrix.git
rm ./gmatrix/.git -rf
MAKE="make -j7" #note this make the compile process use 7 threads
R CMD INSTALL gmatrix
By default, when compiling, the build process assumes that
If these are incorrect assumptions, the user may set these values and install using the following R command as an example.
install.packages("gmatrix" ,
configure.args = "
--with-arch=sm_30
--with-cuda-home=/opt/cuda
--with-r-home=/opt/R
--with-r-include=/opt/R/include/x64"
)
Alternatively, from the command line, use a cammand such as:
R CMD INSTALL gmatrix --configure-args="--with-arch=sm_35"
We recomend that the user test the installation using the following commands:
library(gmatrix)
gtest()
Please report any errors to the package maintainer.