The function uses R's base 'qr' and then applies the gpu to the result to get the final solution.
gpuSolve(x, y=NULL)
x <- matrix(runif(100), 10, 10)
y <- runif(10)
b <- gpuSolve(x, y)
cat("Solution:
")
print(b)
x.inverse <- gpuSolve(x)
cat("an estimate of a pseudo inverse for x:
")
print(x.inverse)
Run the code above in your browser using DataLab