I have been using the package 'gpuR' to increase speed of code manipulating matrices. A matrix (formed by as.matrix(x)) can be converted to a vclMatrix using the code below (vcl indicates the data is stored on the GPU)
vclm <- vcLMatrix(x)
multmatrix <- vclm * vclm
is much quicker than
multmatrix <- x * x
for a large matrix, but how do I convert the multmatrix back into a standard R matrix for further manipulation?
Also, any idea why multiplication is so much faster but element wise addition e.g.
addmatrix <- vclm + vclm
is significantly slower than adding standard matrices?
Many thanks, Antony