Description Arguments Details Value Author(s) See Also Examples
The as.gmatrix
and as.gvector
methods may be used to coerce an object to a given GPU class (i.e. gmatrix
or gvector
).
x, data |
object to be coerced |
type |
The type to convert the object to. There are three different ways to specify this. One may use the |
dup |
This may be set to 'FALSE' to avoid duplicating x in the event that it is on the GPU allready and the original type is the same as the type argument. |
nrow,ncol,byrow,dimnames |
these attributes should generally only be set by a direct call to |
The 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.
An object of type gmatrix
or gvector
Nathan Morris
1 2 | A=matrix(1:10,2,5)
B=as.gmatrix(A)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.