oneapi-src / oneMKL

oneAPI Math Kernel Library (oneMKL) Interfaces
Apache License 2.0
606 stars 155 forks source link

Request to implement lapack::gesv #475

Open npolina4 opened 5 months ago

npolina4 commented 5 months ago

Summary

Request to implement lapack::gesv for lapack_mklcpu, lapack_mklgpu, and lapack_cusolver library.

Problem statement

I use lapack::gesv to solve a linear matrix equation, or system of linear scalar equations.

Preferred solution

Would be great to have same functionality like onemkl::lapack::gesv from Intel oneAPI.

sknepper commented 5 months ago

Thanks for the request, @npolina4 ! Please note that lapack::gesv is not yet part of the oneMKL specification (https://github.com/oneapi-src/oneapi-spec), so it would need to be added to the spec before it could be implemented in the oneMKL interfaces. That said, it seems like a useful addition and there are implementations in different vendor libraries (oneapi::mkl::lapack::gesv, cusolverDn??gesv for ?=D/S/Z/C, rocsolver_?gesv for ?=d/s/z/c).

npolina4 commented 4 months ago

Can you suggest a workaround that I can use until lapack::gesv is implemented? Thanks

sknepper commented 4 months ago

Hi @npolina4 ! Yes, lapack::gesv is essentially a higher-level driver that combines LU factorization followed by solve, lapack::getrf and lapack::getrs, into one call. The example https://github.com/oneapi-src/oneMKL/blob/develop/examples/lapack/run_time_dispatching/getrs_usm.cpp demonstrates these two calls.