The LAPACK library is expected to be thread safe. It does not support multiple threads, so it does not use (all) your kernel system. In fact, there is a specific announcement that all LAPACK routines are thread safe since v3.3 .
LAPACK, on โโthe other hand, is designed to use BLAS library routines. The main BLAS also does not use any streams. However, there are several popular BLAS implementations (ATLAS, OpenBLAS, MKL) that have streaming versions of most BLAS routines. If your LAPACK library uses one of the aforementioned BLAS libraries, it is possible that their routines will start their own threads. Of course, in the above libraries, the user can control the number of threads used. You can review your documentation to learn how to do this.
So, you need to check which BLAS library implementation you are using in order to have a clear idea of โโusing the LAPACK stream.
Regarding the use of pure functions inside, I want to note that both BLAS and LAPACK print specific error messages (stdout or stderr) on the screen. These messages are usually associated with false use of the subroutine, and not with mathematical errors. For example, if you try to invert a zero dimensional matrix. If you can provide this, perhaps you can say that it is clean.
source share