An R interface to write OpenCL functions
This package provide an easy way to access the power of the GPU using the familar R language. The user can write the regular R function and call the gpuSapply function to digest it. The gpuSapply function will translate the R function into openCL code and run it in the GPU, which is supposed to be faster than CPU in math operation. Since the package is still under development, tons of bugs is hidden somewhere and waiting to surprise someone. Please use it with your best judgement.
Before you start to use the package, please make sure you have the CUDA toolkit installed. Even though the package uses openCL as the background language, the current makevars only support CUDA path. If you have another openCL platform, you need to customize the makevars to compile the package.
After installed the package, here is an example about how to use gpu to compute the matrix multiplication:
#Initialize the data
#The traditional way to compute the matrix multiplication
#Use the GPU to run the code
#compute the error
Using the GPU compute, you can expect around 3-6X speedup compared with the optimal CPU counterpart function(e.g %*%). However, since it is not easy to find the optimal CPU code when you are developing your own algorithm, it is more common that you have to rely on the sapply function to loop your code, therefore you will get much more benefit by using this package.