lebedov / scikit-cuda

Python interface to GPU-powered libraries
http://scikit-cuda.readthedocs.org/
Other
986 stars 179 forks source link

Cholesky solve multiple RHS #294

Closed PuncocharM closed 4 years ago

PuncocharM commented 4 years ago

Hi, I would like to compute an inverse of a matrix that is PSD, so I figured I could use cho_solve, where RHS would be an identity matrix. Currently, a 2D matrix as RHS is not allowed in cho_solve and it raises exception: https://github.com/lebedov/scikit-cuda/blob/4781f2e2aa317c3218f9ce1e226a09d7be81af59/skcuda/linalg.py#L813-L814 However after commenting out these two lines, it works with no problem (at least for solver CUSOLVER).

Could it be possible to officialy support multiple RHS for cho_solve or inverse through cholesky? I did not check if everything works in the general case (not just identity, other solvers etc.), so not sure if anything else would need tweaking.

lebedov commented 4 years ago

cho_solve does support 2D RHS matrices, but the matrices have to be in Fortran order (see the cho_solve unit tests). I updated the docstring make this more clear.