createGPU: creategpu

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Create a GPU vector/matrix by copying from the input R vector

Usage

1
creategpu(input, nrow = NULL, ncol = NULL)

Arguments

input

R vector to be copied

nrow

the desired number of rows

ncol

the desired number of columns

Details

This function creates a vector/matrix in GPU by calling the CUDA cudamalloc function, and then copys from input R vector. The output of this function is a list consisting of the GPU pointer and its dimension.

If either one of nrow or ncol is not given, an one column matrix/vector is returned. This function returns row-major matrix.

Value

a list consisting of

Note

output is a R external GPU pointer and can only be used in Rcublas functions

Author(s)

Yuan Li

See Also

gathergpu

Examples

1
2
3
a <- rnorm(6)
a_gpu <- creategpu(a, 2, 3)
gathergpu(a_gpu) 

yuanli22/RCUDA documentation built on May 4, 2019, 6:35 p.m.