Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f3ac970
Upload BLAS/LAPACK, create preprocessor directives
perazz Mar 11, 2024
5882ad6
enable fpm deployment
perazz Mar 11, 2024
ac65112
update `fpm` version in CI
perazz Mar 11, 2024
c25e3ff
add tests
perazz Mar 11, 2024
ce52faf
typo: `getri`
perazz Mar 11, 2024
3e8c5b6
safeguards for qp procedure templates
perazz Mar 11, 2024
29eeec2
public qp interfaces
perazz Mar 11, 2024
8be6484
more `WITH_QP` guards
perazz Mar 11, 2024
a937382
skip unsupported `xdp` precision
perazz Mar 11, 2024
a356f14
Delete .test_trapz.fypp.swp
perazz Mar 11, 2024
2ae057f
unify pre-processing of blas/lapack sources
perazz Mar 12, 2024
edfeb59
OpenMP: replace `cpp` macros with `!$` conditional compilation
perazz Mar 14, 2024
da5d90c
force `example.dat` back into repo
perazz Mar 14, 2024
d379e9c
free-form `!$omp` continuation style
perazz Mar 14, 2024
2be3340
indent OpenMP sentinels
perazz Mar 23, 2024
592e085
remove `FPM_DEPLOYMENT`
perazz Mar 24, 2024
5785f6c
Update src/stdlib_linalg_constants.fypp
perazz Mar 24, 2024
fa3f147
Merge branch 'blas_lapack_backend' of github.com:perazz/stdlib into b…
perazz Mar 24, 2024
281b068
Document BLAS/LAPACK backends
perazz Mar 26, 2024
4586f32
typo
perazz Mar 26, 2024
3c2349f
Update doc/specs/stdlib_linalg.md
perazz Mar 26, 2024
464aba4
Update doc/specs/stdlib_linalg.md
perazz Mar 26, 2024
a56d685
Update doc/specs/stdlib_linalg.md
perazz Mar 26, 2024
819f2b2
add Licensing information
perazz Mar 26, 2024
a46b86f
add `Syntax` section
perazz Mar 26, 2024
ae6c009
clarify fpm macros
perazz Mar 26, 2024
545b4c3
link to the conversion script
perazz Mar 26, 2024
e30b2ec
dnrm2/snrm2: fix missing interface type
perazz Mar 27, 2024
745bcf8
shorten doc comment
perazz Mar 27, 2024
c12b3c3
lapack interface: import procedure interfaces
perazz Mar 27, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add Syntax section
  • Loading branch information
perazz committed Mar 26, 2024
commit a46b86f1846ec1fc222f56c6b048df7c4bc9b815
50 changes: 49 additions & 1 deletion doc/specs/stdlib_linalg.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,55 @@ macros = ["STDLIB_EXTERNAL_BLAS", "STDLIB_EXTERNAL_LAPACK"]

or directly via compiler flags:

`fpm build --flag "-DSTDLIB_EXTERNAL_BLAS -DSTDLIB_EXTERNAL_LAPACK -framework Accelerate"`.
`fpm build --flag "-DSTDLIB_EXTERNAL_BLAS -DSTDLIB_EXTERNAL_LAPACK -lblas -llapack"`.

### Syntax

All procedures in the `BLAS` and `LAPACK` backends follow the standard interfaces from the
[Reference LAPACK](https://www.netlib.org/lapack/). So, the online [Users Guide](https://www.netlib.org/lapack/explore-html/)
should be consulted for the full API and descriptions of procedure arguments and their usage.

The `stdlib` implementation makes both kind-agnostic and specific procedure interfaces available via modules
[stdlib_linalg_blas(module)] and [stdlib_linalg_lapack(module)]. Because all procedures start with a letter
[that indicates the base datatype](https://www.netlib.org/lapack/lug/node24.html), the `stdlib` generic
interface drops the heading letter and contains all kind-dependent implementations. For example, the generic
interface to the `axpy` function looks like:

```fortran
!> AXPY: constant times a vector plus a vector.
interface axpy
module procedure stdlib_saxpy
module procedure stdlib_daxpy
module procedure stdlib_qaxpy
module procedure stdlib_caxpy
module procedure stdlib_zaxpy
module procedure stdlib_waxpy
end interface axpy
```

The generic interface is the endpoint for using an external library. Whenever the latter is used, references
to the internal `module procedure`s are replaced with interfaces to the external library,
for example:

```fortran
!> AXPY: constant times a vector plus a vector.
interface axpy
pure subroutine caxpy(n,ca,cx,incx,cy,incy)
import sp,dp,qp,ilp,lk
implicit none(type,external)
complex(sp), intent(in) :: ca,cx(*)
integer(ilp), intent(in) :: incx,incy,n
complex(sp), intent(inout) :: cy(*)
end subroutine caxpy
! [....]
module procedure stdlib_qaxpy
end interface axpy
```

Note that the 128-bit functions are only provided by `stdlib` and always point to the internal implementation.
Because 128-bit precision is identified as [stdlib_kinds(module):qp], initials for 128-bit procedures were
labelled as `q` (quadruple-precision reals) and `w` ("wide" or quadruple-precision complex numbers).
Extended precision ([stdlib_kinds(module):xdp]) calculations are currently not supported.

### Example

Expand Down