as.gmatrix
and as.gvector
methods may be used to coerce an object to a given GPU class (i.e. gmatrix
or gvector
).
"double"
, "single"
, "integer"
or "logical"
notation. Alternatively the short form "d"
, "s"
, "i"
or "s"
notation may be used. Finally the internal integer representation of 0L, 1L, 2L or 3L may be used.gmatrix
gmatrix
or gvector
as.gmatrix
and as.gvector
methods may be used to move an R object to the current GPU device and returns an object of class
gmatrix
or gvector
respectively. The methods have the following arguments:as.gmatrix(data = NA, nrow = 1L, ncol = 1L, byrow = FALSE, dimnames = NULL, type = NULL, dup = TRUE) as.gvector(x, type=NULL, dup=TRUE)
The dup
argument is used only when the input argument (data
) is all ready on the GPU.
dup=FALSE
will return the original data without duplicating it on the GPU.
g
, gmatrix
and gvector
A=matrix(1:10,2,5)
B=as.gmatrix(A)
Run the code above in your browser using DataLab