R functions for computation on GPU