How can I use the BLAS implementations included in Apple Accelerate Framework with MATLAB R2023b Update 4?
조회 수: 304 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2023년 11월 8일
댓글: Mike Croucher
2023년 12월 13일
How can I use the BLAS implementations included in Apple Accelerate Framework with MATLAB R2023b Update 4?
채택된 답변
MathWorks Support Team
2023년 12월 1일
편집: MathWorks Support Team
2023년 12월 1일
The BLAS implementation currently used by default in MATLAB on Apple Silicon processors is OpenBLAS. MATLAB is only qualified using the OpenBLAS version that is included with MATLAB.
After working closely with Apple, MacOS 13.3 brought ILP64 compatible BLAS APIs to Apple Accelerate Framework's BLAS.
If you are using an Apple Silicon processor and run on MacOS 13.3 or newer, you may prefer to use the BLAS implementation which is included with MacOS's Apple Accelerate Framework. Starting with MATLAB R2023b Update 4, this library has completed preliminary qualificiation for use with MATLAB and can be selected following the below instructions.
In order to use Apple Accelerate Framework's BLAS (AF_BLAS) with MATLAB, open a command prompt and define the environment variable BLAS_VERSION by running the following command:
$ export BLAS_VERSION=libmwAF_BLAS_ilp64.dylib
Notice that depending on the used MacOS shell, the command to define ENVs might differ.
Once the ENV has been set, start MATLAB from within the same command prompt to use AF_BLAS:
> matlab
To revert the BLAS library MATLAB uses to the default library, close MATLAB and clear the environment variable:
$ unset BLAS_VERSION
To verify that MATLAB is using the desired BLAS library, type the following at the MATLAB prompt:
>> version -blas
In MATLAB R2023b Update 4 this should return:
BLAS: trying environment BLAS_VERSION...
BLAS: loading libmwAF_BLAS_ilp64.dylib
BLAS: loaded libmwAF_BLAS_ilp64.dylib@0xa0a3a390
ans =
'Apple Accelerate BLAS (ILP64)'
The procedure explained above is only active within the used command window. In order to always start MATLAB using AF_BLAS, permanently set these environment variables by adding the ENV BLAS_VERSION with the value described above to your ~/.bashrc.mine, ~/.profile, or similar.
댓글 수: 1
Mike Croucher
2023년 12월 13일
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!