19 Commits
Author SHA1 Message Date
Martin Kroeker 63ad298a67 Merge branch 'develop' into attrib-hidden 2026-07-21 20:00:16 +02:00
Yue ChangandClaude Fable 5 ede136ee4e Fix 32-bit integer overflow in LAPACKE nancheck index arithmetic
The optional NaN checks performed by LAPACKE front-ends computed array
offsets and lengths in 32-bit lapack_int arithmetic, which overflows for
large matrices (e.g. LAPACKE_dpotrf with n = lda >= 46341 overflows
j*lda in LAPACKE_dtr_nancheck, leading to out-of-bounds reads and
crashes). Several nancheck helpers (ge, gb, tp, tf) already cast to
size_t; this applies the same treatment to the ones that were missed:

- ?tr_nancheck: cast a[i+j*lda] index to size_t (also covers po/sy/he
  checks, i.e. the POTRF/Cholesky path)
- ?_nancheck (vector): iterate by element count instead of n*inc, with
  size_t indexing
- ?sp/?pp/?pf/?hp/?tp/?tf_nancheck: compute n*(n+1)/2 length in size_t
- ?tz_nancheck: widen the part offsets to int64_t (keeping the -1
  sentinel) and compute them with a widening cast

Verified with UBSan: LAPACKE_str_nancheck at n = lda = 47000 previously
reported signed integer overflow and crashed with SEGV at -O0; it now
passes and still detects the NaN. Old and new code produce identical
results across 1907 enumerated small-size cases (all layouts, uplo,
diag, shapes and NaN positions for tr/tz/vector/packed variants).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 23:42:28 -04:00
mattip be7da1f111 add visibility=default to exported functions, visibility=hidden to most assembler 2026-02-05 06:31:17 +11:00
Martin Kroeker 8a418b1aab Add dummy implementations for the LAPACK_COMPLEX_CUSTOM case 2025-03-12 23:20:16 +01:00
Martin Kroeker be05ba4374 Fix typos in comments and documentation of LAPACK (Reference-LAPACK PR 820) (#4045)
* Fix typos in comments and documentation (Reference-LAPACK PR 820)
2023-05-18 16:28:20 +02:00
Martin Kroeker 05fbc81409 rewrite the ifdef as Windows cl failed to parse it 2022-12-14 15:16:53 +01:00
martin-frbg 5b14be1f35 Leave out the Fortran character length arguments when compiling with emscripten 2022-12-14 14:02:36 +01:00
Martin Kroeker c2ba4e6249 Remove unnecessary return in void function call (Reference-LAPACK PR760) 2022-11-23 10:43:34 +01:00
Martin Kroeker 74962c7f53 Remove unnecessary return in void function call (Reference-LAPACK PR760) 2022-11-23 10:42:29 +01:00
Martin Kroeker d952cbf7bc Remove unnecessary return in void function call (Reference-LAPACK PR760) 2022-11-23 10:41:50 +01:00
Martin Kroeker 7694ff495f Remove unnecessary return in void function call (Reference-LAPACK PR760) 2022-11-23 10:40:59 +01:00
Martin Kroeker eba1112e38 Add NaN check functions for trapezoidal matrices (Reference-LAPACK PR738+742) 2022-11-13 15:03:39 +01:00
martin-frbg 329cdc31b3 Update LAPACK/LAPACKE to Reference-LAPACK 3.10.1 2022-04-21 20:39:29 +02:00
Martin Kroeker 375b1875c8 [WIP] Update LAPACK to 3.9.0 (#2353)
* Update make.inc entries for LAPACK 3.9.0

Reference-LAPACK PR 347 changed some variable names and relative paths

* Update LAPACK to 3.9.0

* Add new functions from LAPACK 3.9.0

* Add new functions from LAPACK 3.9.0

* Restore LOADER command 

as it makes it easier to specify pthread as needed

* Restore LOADER

* Restore EIG/LIN prefixes in cmdbase

* add binary path to lapack_testing.py call

* Restore OpenMP version check

* Restore OpenMP version check

* Restore fix for out-of-bounds array accesses

from #2096
2020-01-01 13:18:53 +01:00
martin 3be5c3d343 Update LAPACK to 3.8.0 2017-11-23 18:13:35 +01:00
Werner Saar d35baf30cf added lapack 3.7.0 with latest patches from git 2017-01-06 11:48:40 +01:00
Werner Saar 8cd46acebb removed lapack 3.6.0 2017-01-06 11:44:57 +01:00
Martin Köhler 13d40e7591 Import LAPACK: LAPACKE directory 2016-10-26 15:06:08 +02:00
Werner Saar 33e37d01b3 added lapack-3.6.0 2015-11-20 09:45:46 +01:00