MATLAB Answers

Can matlab coder generate code that uses a specified external uBLAS linear algebra library included with BOOST?

16 ビュー (過去 30 日間)
Danimal
Danimal 2018 年 8 月 1 日
コメント済み: Royi Avital 2020 年 4 月 25 日
Can the matlab coder application be used to generate C/C++ code that works with the C/C++ uBLAS linear algebra library and matrix data types included with BOOST ?
If so, Can you please provide some examples of code generation integration with support for BOOST and uBLAS? If not, Can you please provide tips/recommendations for BOOST and uBLAS support?
I'm open to exploring other alternatives such as the following:
  • Use the numeric binding adaptor for LPACK to UBLAS as indicated at: https://github.com/uBLAS/numeric_bindings How do I configure the matlab coder to support LAPACK interface? Is there any examples for this?
  • Use the open source Octave https://www.gnu.org/software/octave/ application to do the Matlab code to C++ conversion which claims to have support for UBLAS?
  • Use https://github.com/jonathf/matlab2cpp with Armadillo wrappers for UBLAS
  • Use https://github.com/rboorgapally/boost-ublas-extensions with UBLAS to hand convert the matlab code

  0 件のコメント

サインインしてコメントする。

採用された回答

Ryan Livingston
Ryan Livingston 2018 年 8 月 3 日
編集済み: Ryan Livingston 2018 年 10 月 12 日
Update Starting in R2018b you can generate code that calls a CBLAS as well as an LAPACK library:
Starting in R2016a, MATLAB Coder can generate code that calls an LAPACK library using the LAPACKE interface:
That will allow you to leverage an optimized LAPACK library for high-level linear algebra operations like solving systems, doing matrix decompositions, etc. There are various LAPACK implementations available for different hardware. You can also get an optimized BLAS library and then use the reference LAPACK from netlib.org and point it to your optimized BLAS.
OpenBLAS provides an optimized BLAS and partially optimized LAPACK library for several platforms:
ATLAS provides automatically tuned BLAS and a few LAPACK routines for multiple platforms:
And there are various other optimized libraries available which may or may not be free:
There are also many other optimized BLAS libraries available including:
These could be linked with the Netlib reference LAPACK/LAPACKE:
Also note that some of these libraries may be available in system package managers like apt, yum, homebrew, etc.
Question
MATLAB Coder does not support generating code which uses the uBLAS functions or types. Could you please expand on why you chose uBLAS? Is performance your main concern? Style of the generated code? Something else?

  1 件のコメント

Royi Avital
Royi Avital 2020 年 4 月 25 日
What about linking to Intel MKL (As it is shipped with MATLAB)?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品


リリース

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by