This release note covers the LAPACK Performance Libraries v1.0r2.
LAPACK (Linear Algebra PACKage) is a software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition. LAPACK was written in FORTRAN 90 and the original routines handle both real and complex matrices in both single and double precision.
The LAPACK Performance Libraries are based on LAPACK 3.7.0 (see the Netlib site at http://www.netlib.org/lapack). The Fortran code is converted to C code and the provided functions handle real matrices and single precision only.
The LAPACK Performance Libraries are comprised of three separate physical libraries: the LAPACK principal function library, the BLAS basic function library and the F2C support function library. The F2C library is a run-time library that is used by the LAPACK and BLAS library.
The BLAS (Basic Linear Algebra Subprograms) library contains functions that provide standard building blocks for performing basic vector and matrix operations. These functions form the low-level layer of LAPACK. Machine-specific optimized BLAS libraries are available for a variety of computer architectures. The LAPACK Performance Libraries v1.0r2 provide such an optimized BLAS implementation for Infineon TriCore.
The LAPACK version is updated from 3.6.1 to 3.7.0. Refer to the Netlib website to find what's new in version 3.7.0.
All of the BLAS functions now have optimized C code for use with the TASKING VX-toolset for TriCore C compiler.
restrict
keyword has been added to all pointer parameters of the BLAS function declarations.
Such a pointer declaration tells the compiler that (in the declaration's scope) the underlying object
is only accessed (directly or indirectly) via that specific pointer. The compiler may then assume that
no pointer aliasing can occur, enabling improved optimization.
Be aware that this has consequences for the application code: the programmer must make sure that in a BLAS or LAPACK
function call, each pointer is indeed the only thing that accesses (points to) the underlying object.
Due to the optimizations in the BLAS functions the following improvements were obtained. Only the results for a selection of commonly used functions are mentioned here.
Function | Parameters | v1.0r1 | v1.0r2 | Relative change |
---|---|---|---|---|
sgemm | size=30x30, not transposed, α=1, β=0 | 134 MFLOPS | 206 MFLOPS | +54% |
sgemv | size=30x30, not transposed, α=1, β=1 | 131 MFLOPS | 189 MFLOPS | +44% |
ssymm | size=25x25, side=L, uplo=U, α=1, β=0 | 58 MFLOPS | 107 MFLOPS | +84% |
Notes
The API has been changed in the following areas.
restrict
keyword is declared on some of the function parameters.
If you have legacy code you can keep using the old API, but since the old prototypes are not available
anymore in the new lapack.h
include file, you will have to provide your own prototypes.
By default, the LAPACK libraries are now configured to assume 4-byte alignment for single-word objects (int, long, float).
An application that uses these libraries must be built with the same compiler option (--eabi=H
) to prevent
alignment mismatches.
The matlab-cholesky
example is added to the product and shows how to use MATLAB®
to rapidly develop an algorithm using the LAPACK functions that are provided with the MATLAB®
LAPACK Add-On. When you are done with prototyping in MATLAB®, you can easily transform the
algorithm to C code for TriCore by using the MATLAB® Coder. The C code for TriCore then calls
the functions supplied with the LAPACK Performance Libraries.
For details on how to re-generate the C code using MATLAB® or how to import the example in the TASKING VX-toolset
for TriCore, please refer to the readme that is part of the example.
The LAPACK Performance Libraries are shipped as a set of source files and makefiles. In order to use the libraries, you need to extract the source files and build the libraries first.
For Windows, the LAPACK Performance Libraries will be installed in the 'Program Files (x86)' folder by default. This folder has only limited write access, so in order to be able to unpack and build the libraries from within this location you need Windows Administrator rights. To be able to continue you have to start a command prompt as administrator. You can achieve this by following these steps:
If you do not have administrator rights on your PC, then install the LAPACK Performance Libraries outside the 'Program Files (x86)' folder, by selecting a different location when the installation program asks you to provide an installation folder.
Do not install the product in an existing TASKING VX-toolset installation directory, since this may damage your TASKING VX-toolset license file.
For the next instruction it is assumed that the product is installed in the
default location and that you have opened a command prompt with administrator
rights.
In directory ctc\lib\src.lapack
of the LAPACK Performance Libraries
product a makefile is available that takes care of unpacking, building and copying the LAPACK
Performance Libraries. It is advised that you use this makefile.
The makefile executes the following commands:
tc16x
) and one for AURIX 2G (located in subdirectory
tc162
). In total there are six sub makefiles available:ctc\lib\tc16x
, while the AURIX 2G
libraries are copied to directory ctc\lib\tc162
of the LAPACK Performance
Libraries product.
Now suppose you have purchased TriCore VX-toolset version v6.2r1 and it is
installed in the default location: C:\Program Files (x86)\TASKING\TriCore v6.2r1
.
If you want to build the LAPACK Performance Libraries for AURIX and AURIX 2G using this
version, then go to the location of the main makefile and run the make utility amk
by specifying its complete path. Invoke the following commands in a command shell:
C: cd "\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\src.lapack" "C:\Program Files (x86)\TASKING\TriCore v6.2r1\ctc\bin\amk"
As a result of this make action, the libraries are unpacked, they are built and the
AURIX versions are copied to the ctc\lib\tc16x
directory of the LAPACK
Performance Libraries product.
The AURIX 2G versions of the libraries are copied to the ctc\lib\tc162
directory.
It is also possible to build the LAPACK Performance Libraries with an older version of the tools, i.e. TriCore VX-toolset versions v4.x or v5.x. However these older versions of the tools do no support AURIX 2G derivatives. In case you want to build the LAPACK Performance Libraries with an older version, you need to run the make utility amk with argument aurix to avoid build errors.
C: cd "\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\src.lapack" "C:\Program Files (x86)\TASKING\TriCore v5.0r1\ctc\bin\amk" aurix
As a result of this make action, only the libraries for AURIX are unpacked, they are
built and copied to the ctc\lib\tc16x
directory of the LAPACK Peformance
Libraries product.
This completes the preparation of the libraries.
Once the LAPACK Performance Libraries have been built, an application can use the LAPACK functions. All that is required is that the tools know where to find the libraries.
When invoking the compiler, specify the location of the header file
by using the -I option.
For example:
ctc ... -I"C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\include.lapack" myapp.c ...
When invoking the linker, specify the location of the libraries by using
the -L option and the libraries by using the -l option.
For example:
ltc ... myapp.o -L"C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\tc16x" -llapack_fpu -lblas_fpu -lf2c_fpu ...
Specify the location of the header file in the C/C++ Compiler Options on the Settings Properties page:
"C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\include.lapack"
Specify the libraries in the Linker Options on the Settings Properties page:
"C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\tc16x\liblapack_fpu.a"
libblas_fpu.a
and libf2c_fpu.a
.In the examples directory of the product you can find two different examples of computing the Cholesky factorization. The cholesky example is the handwritten version, while the matlab-cholesky example uses code that is generated by MATLAB®.
In the ctc\doc
directory of the product you can find the API documentation.
The API documentation is in HTML format and provided to you as a ZIP file. If
you want to use the documentation then unzip the file named lapack_apidoc.zip
with any unzip program. Note that if you have installed the LAPACK Performance Libraries in the
'Program Files (x86)' folder, you have to run the unzip tool as administrator.
By default the HTML files are extracted to directory ctc\doc\lapack-apidoc
.
Open the file index.html
that is present in this directory with your
favorite browser to start navigate the documentation.
Note that the LAPACK Performance Libraries are based on Fortran code that is converted to C code. The API documentation is partially derived from the Fortran code and partially derived from the C code and therefore may not be ideal. You will find function signatures in C notation, where the arguments are denoted in lowercase and in many cases the arguments are pointers. The described parameters on the other hand are in Fortran notation, i.e. parameters are denoted in uppercase and all parameters are pointers implicitly.
The sqrtf() function in the C library of the TASKING VX-toolset for TriCore up to release v6.2r1 does not meet the precision requirement of the LAPACK test suite. An improved version of the sqrtf() function is included in the F2C support function library of the LAPACK Performance Libraries product. When linking against the LAPACK libraries the improved precision version will prevail over the C library version.
The LAPACK ieeeck() function does not pass the LAPACK test suite if it is compiled with the default compiler optimization level '-O2' because it will replace expressions of the form 'x == x' with TRUE. However, if x equals NaN the expression should return FALSE. Therefore, the ieeeck.c module is compiled with compiler option '-O0'.
TASKING products are protected with TASKING license management software.
You need a license key when you install a TASKING product on a computer. When you order a TASKING product from Altium or one of its distributors, a license key will be sent to you by email or on paper.
See Obtaining a License on our website for more information.
If you have ordered a TASKING product with a floating license, you can have it serviced by the Remote TASKING License Server (the most convenient solution) or through a Local TASKING License Server (in case you have no external network access for example). Consult your Altium representative for assistance on deciding what the best setup would be for your situation.
If you like to setup up a local license server, we kindly refer you for more information to Support for TASKING License Management System (TLM) on our website. Here you can also download the Local TASKING License Server package.
It is advised that you install the Local TASKING License Server before you install products that require this server.