Noob Question about CUBLAS

I’m trying to implement “cublasDgelsBatched()”, and i’m a bit confused about how the function works. In the manual, it says that the i’th Least Squares Solution over-writes the i’th input matrix Carray[i]. What I’m wondering is, since the solution is, in general, not the same dimensions as the Carray[i], how should I access the solution? And what happens to the parts of Carray[i] for which there are not enough elements from the solution to over-write?

Specifically, how would I index into the i’th solution if I want to copy it from the device back onto a host-side solution array?

yep, face the exact same question when reading the doc. The doc is little bit misleading to let developer think Carray should setup with n x nrhs but it should be m x nrhs, just finished build customized function apply “cutlasSgelsBatched”, Carray is setup with m x nrhs and it indeed able to work. The cublas doc will be updated soon and already mentioned this to the team. Thanks!