Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference (if there is any) between BLAS/LAPACK in Mac OS and the original BLAS/LAPACK?

I recently switch to Mac OS from Linux. I need BLAS and LAPACK to do some computation. By checking Wikipedia of BLAS, I learnt these two libraries have beed implemented in Mac OS. However, it is said that

Apple's framework for Mac OS X and iOS, which includes tuned versions of BLAS and LAPACK. (https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms)

So, what the difference between the MAC BLAS/LAPACK and the original ones? (I checked the references referred in the wikipedia, but I didn't find information about the difference.)


1 Answers

There are many implementation of BLAS and LAPACK, there is no single Linux version either. There is a specification of the interface of the routines and a reference implementation on netlib.org, but that reference implementation is not that focused on maximum performance on particular platform (CPU, OS...).

So, what the Mac library does is that it has its own code for doing some of the computation, which is probably faster than the reference one. It may be programmed in a different programming language, than the reference Fortran code.

There are many other implementations you could try: Intel MKL, ATLAS, GotoBLAS, OpenBLAS, Sun Performance Library, Cray Scientific Libraries and others. Often they are written in C or in the assembly language for a particular CPU.

The most important feature that Apple advertises for its Accelerate framework and the vecLib (which contain the BLAS) is the optimized usage of the vector (SIMD) instructions. That what all other versions also try to do. For the actual differences from other implementations it would be necessary to study the source code which is often unavailable (at least for the commercial libraries).

like image 119
Vladimir F Героям слава Avatar answered Oct 21 '25 14:10

Vladimir F Героям слава



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!