The GPU computing is very popular since its capability of parallel computing. The environment of ubuntu is adequate to try GPU computing and its setting is easier than in window. I introduce the installation of CUDA, nVidia driver and R packages of GPU.
R with GPU performance of HiPLARM
This post is to benchmark the performance of HiPLARM and to introduce how to install HiPLARM.
Search Maximum Point by Point
We have an image data, it is discrete and I want to find the local maximum. I write a Rcpp function for searching maximum point by point.
Rcpp Attributes for Sparse Matrix
Thanks to the R package Matrix
, we can use the sparse matrix in R. But to use the sparse matrix in the Rcpp
, we need create a S4 object to get sparse matrix in Rcpp
. However, RcppArmadillo
provides a convenient API for interfacing the armadillo class SpMat
and R class dgCMatrix
. I provide several methods to use the sparse matrix in R.
R data.table - subsets
data.table
is a powerful tool for exploring data. However, how is it fast? Here we provides a performance test for subsetting data.
R data.table - melt and cast
data.table
is a powerful tool for exploring data.
Here we provides a example for melting and casting data.
R data.table - collating data
data.table
is a powerful tool for collating data. Here we provides a example. Recently, I join a team and participate a competition of R data analysis.
R data.table - sum by groups
data.table
is a powerful tool for exploring data. However, how is it fast? Here we provides a performance test for summing by groups.
R Performance for calculating the maximum of two normal random variable
There is a performance test between R functions, R functions with byte compiler, Rcpp and RcppArmadillo. It is about the generating the normal random variables and the vectorized computations.
Rcpp Attributes for kernelMatrix with openmp
I use Rcpp Attributes to compute the kernel matrix and show how to link omp to speedup your Rcpp code. I also present that the speed of Rcpp Attributes is competitive with the function kernelMatrix written in C in the R package kernlab.
Code:
1 | library(kernlab) |
With openmp, it is faster than kernlab with small input matrix size, however, the efficiency is too low when the size increase. Another efficient method is listed below:
1 | library(kernlab) |
The above result show that there is a trick you should know to speedup the code: if you can directly use matrix manipulation to finish the calculation, then please do it! Or you get low efficiency if you use for loop.
My environment is ubuntu 14.04, R 3.1.1 compiled by intel c++, fortran compiler with MKL. My CPU is 3770K@4.3GHz.