Solving an overdetermined system of linear equations


I want to solve a system of linear equations on the GPU, i.e. find X in AX = B. First idea was to use CUBLAS, but it seems to have only routines for square matrices A (n x n). I, however, have a generally overdetermined system with A being k x n (k > n).
Any ideas on what to do? You guys know of an appropriate implementation?


Magma includes a QR factorization routine you should be able to use for this.