Skip to content

Commit 8ab799a

Browse files
authored
Update README.md
1 parent c4c9860 commit 8ab799a

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# *** WORK IN PROGRESS ***
1+
# fortran-lapack
2+
This package provides precision-agnostig, high-level linear algebra APIs for `real` and `complex` arguments in Modern Fortran. The APIs are similar to NumPy/SciPy operations, and leverage a Modern Fortran implementation of the [Reference-LAPACK](http://github.com/reference-LAPACK) library.
23

34
# Current API
45
Procedure | Type | Description | Optional arguments
@@ -25,10 +26,9 @@ Procedure | Type | Description | Optional arguments
2526

2627
All procedures work with all types (`real`, `complex`) and kinds (32, 64, 128-bit floats).
2728

28-
# fortran-lapack
29-
This package contains a Modern Fortran implementation of the [Reference-LAPACK](http://github.com/reference-LAPACK) library.
30-
The reference Fortran-77 library is automatically downloaded from its master repository, and processed to create Modern Fortran modules with full explicit typing features.
31-
Release 3.10.1 is currently targeted. Function interfaces are unchanged from the original implementation, and allow future extension to handle its usage through external implementations.
29+
# BLAS, LAPACK
30+
Modern Fortran modules with full explicit typing features are available as modules `la_blas` and `la_lapack`.
31+
The reference Fortran-77 library, forked from Release 3.10.1, was automatically processed and modernized.
3232
The following refactorings are applied:
3333
- All datatypes and accuracy constants standardized into a module (`stdlib`-compatible names)
3434
- Both libraries available for 32, 64 and 128-bit floats
@@ -56,11 +56,22 @@ fortran-lapack = { git="https://github.com/perazz/fortran-lapack.git" }
5656
```
5757
# Extension to external BLAS/LAPACK libraries
5858

59-
This task is in progress. The names of all procedures have been prefixed not to pollute the original BLAS/LAPACK namespace, so that handling of external libraries can be accomplished via a preprocessor flag. For example:
59+
Generic interfaces to most BLAS/LAPACK functions are exposed to modules `la_blas` and `la_lapack`. These interfaces drop the initial letter to wrap a precision-agnostic version. For example, `axpy` is a precision-agnostic interface to `saxpy`, `daxpy`, `caxpy`, `zaxpy`, `qaxpy`, `waxpy`.
60+
The naming convention is:
61+
62+
Type | 32-bit | 64-bit | 128-bit
63+
--- | --- | --- | ---
64+
real | `s` | `d` | `q`
65+
complex | `c` | `z` | `w`
66+
67+
All public interfaces in `la_blas` and `la_lapack` allow seamless linking against external libraries via a simple pre-processor flag.
68+
When an external library is available, just define macros `LA_EXTERNAL_BLAS` and `LA_EXTERNAL_LAPACK`. The kind-agnostic interface
69+
will just point to the external function. All such interfaces follow this template:
6070

6171
```fortran
62-
#ifdef EXTERNAL_BLAS
63-
interface
72+
interface axpy
73+
#ifdef LA_EXTERNAL_BLAS
74+
! Use external library
6475
pure subroutine saxpy(n, a, x, incx, y, incy)
6576
import :: ik, sp
6677
integer, parameter :: wp = sp
@@ -71,12 +82,11 @@ interface
7182
real(wp), intent(inout) :: y(*)
7283
integer(ik), intent(in) :: incy
7384
end subroutine saxpy
74-
end interface
7585
#else
76-
interface saxpy
77-
module procedure stdlib_saxpy
78-
end interface
86+
! Use internal implementation
87+
module procedure la_saxpy
7988
#endif
89+
end interface
8090
```
8191

8292
# Licensing
@@ -86,4 +96,4 @@ The license used for the software is the [modified BSD license](https://www.netl
8696
According to the original license, we changed the name of the routines and commented the changes made to the original.
8797

8898
# Acknowledgments
89-
The development of this package is supported by the [Sovereign Tech Fund](https://www.sovereigntechfund.de).
99+
Part of this work was supported by the [Sovereign Tech Fund](https://www.sovereigntechfund.de).

0 commit comments

Comments
 (0)