Commit Graph
3801 Commits
Author SHA1 Message Date
langou 018bf9f330 Merge pull request #1344 from ACSimon33/rotmg_compact_flags
BLAS: Restore compact ROTMG flag output when no rescaling occurs
2026-08-01 09:02:06 -06:00
Simon MaertensandClaude Fable 5 7e1c743aef BLAS: Restore compact ROTMG flag output when no rescaling occurs
6dc1a78ea normalized DFLAG 0/1 to -1 for every regular result,
contradicting the documented compact DPARAM forms and failing the
xblat1 ROTMG tests at points 1-2. The ELSE IF guard alone is enough
to fix the #244 clobber, so keep the normalization inside the loops.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-30 18:40:36 +02:00
langou cf47d31736 Merge pull request #1343 from ACSimon33/extended_api_xerbla_tests
Fix extended API xerbla tests
2026-07-30 09:46:02 -06:00
Simon Maertens ab2a097f93 BLAS: Don't truncate routine names in extended API xerbla tests 2026-07-30 17:21:30 +02:00
Simon Maertens 12879438bd BLAS: Fix complex level 2 extended API xerbla tests 2026-07-30 17:21:29 +02:00
Simon Maertens 92dd179c2b CBLAS: Fix the expected routine name in xerbla tests for extended API builds 2026-07-30 16:59:48 +02:00
langou fb9b904cc2 Merge pull request #1342 from ACSimon33/dmd_test_singvqx_index
TESTING: scale the xGEDMDQ residual check by SINGVQX(KQ)
2026-07-30 08:07:39 -06:00
langou c3b628bfd7 Merge pull request #1341 from ACSimon33/cblas_testing_counts
CBLAS: count tests and report CBLAS results in the test summary
2026-07-30 08:05:52 -06:00
Simon MaertensandClaude Opus 5 e5757e68ee TESTING: scale the xGEDMDQ residual check by SINGVQX(KQ)
SINGVQX is only filled to KQ, so SINGVQX(K) read uninitialized memory
whenever DGEDMD's rank K exceeded DGEDMDQ's KQ -- harmless in the
default API by luck, an abort in the _64 build. cchkdmd/zchkdmd
already use KQ.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 15:13:24 +02:00
Simon Maertens ff94382e72 Whitespace fix 2026-07-30 15:12:47 +02:00
Simon Maertens 4b40962a13 Added JUnit XML output to lapack_testing.py script. 2026-07-30 15:10:28 +02:00
Simon Maertens 25fa8f2f6b Merge branch 'master' into cblas_testing_counts 2026-07-30 13:14:51 +02:00
langou c08a083be7 Merge pull request #1340 from ACSimon33/cblas_xerbla_unify
CBLAS: unify the XERBLA name/INFO logic between the library and the test harness
2026-07-29 19:27:08 -06:00
langou 48d198aadb Merge pull request #1339 from ACSimon33/blas_testing_counts
Report BLAS test counts and summarize the BLAS tests in `lapack_testing.py`
2026-07-29 19:26:23 -06:00
Simon Maertens 54964f8f88 Use --merge-apis in the CTest and Makefile test summaries 2026-07-29 17:19:51 +01:00
Simon Maertens fdc78becbc lapack_testing.py: add --merge-apis to combine identical API sections
Collapses a library's two API sections into one table when they report
the same errors. Compared per output file, so a missing file or two
different failures with equal totals keep the sections split.
2026-07-29 16:04:10 +01:00
Simon MaertensandClaude Opus 5 6e157dd062 lapack_testing.py: analyze the CBLAS test output
Add the CBLAS suite as its own library, alongside LAPACK and BLAS:

  - A test case per precision and BLAS level. The CBLAS inputs carry no
    output file name, so the same input serves both APIs and the harness
    redirects the output for every level, unlike the BLAS Level 2 and 3
    drivers.
  - --cblas-dir, defaulting to CBLAS/testing, which is the correct
    relative path from both a CMake build root and the source tree. A
    missing directory is skipped silently, since CBLAS is off by
    default.
  - The verdict and count patterns accept the COLUMN-MAJOR and ROW-MAJOR
    tags the CBLAS drivers add, which the BLAS drivers do not emit.

The parser itself is shared with BLAS: both suites report their counts
in the same form, so only the layout tags and the test tables differ.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:04:09 +01:00
Simon MaertensandClaude Opus 5 a88a328c9f CBLAS: count tests in the Level 1 drivers
Like their BLAS counterparts, the Level 1 testers print only a PASS line
or a bare FAIL per subprogram, with no counts and no footer. Report:

     CBLAS_SDOT      COMPUTATIONAL TESTS:       16 RUN,        0 FAILED

One test is one element comparison in STEST or ITEST1; CTEST delegates
to STEST and is not counted separately. The counters travel in a new
/CNTBLA/ block and the subprogram name reaches the main program from
HEADER through /NAMBLA/, matching the BLAS Level 1 drivers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:04:08 +01:00
Simon MaertensandClaude Opus 5 8250cb5ce2 CBLAS: count error-exit tests
The C error-exit checkers report only a pass/fail verdict per routine.
Report the counts too, matching the Fortran drivers:

     cblas_sgemv      ERROR-EXIT TESTS:       13 RUN,        0 FAILED

One test is one chkxer() call. A test fails either because the routine
never reached xerbla, which chkxer already detects through cblas_lerr,
or because c_xerbla.c was reached with the wrong routine name, which
clears cblas_ok without chkxer noticing. The extended API build hits
exactly that second case, reporting cblas_sgemv_64 against an expected
cblas_sgemv, so a new cblas_xbad flag carries it across and the counts
agree with the verdict.

The Windows path that skips the xerbla tests returns before printing a
verdict and so prints no counts either.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:04:07 +01:00
Simon MaertensandClaude Opus 5 1be34149cb CBLAS: count computational tests in the Level 2 and 3 drivers
Report how many tests each routine ran and how many failed, in the same
shape as the BLAS drivers, tagged with the data layout so the two passes
stay distinguishable:

     cblas_sgemv      COLUMN-MAJOR COMPUTATIONAL TESTS:  3456 RUN, 0 FAILED
     cblas_sgemv      ROW-MAJOR    COMPUTATIONAL TESTS:  3456 RUN, 0 FAILED

As in the BLAS drivers, NTESTS and NFAILS sit beside the existing
ERRMAX, are incremented where ERRMAX accumulates, and are reported at
the common exit so every verdict path carries them. The paths that set
FATAL bump them too, so an aborting routine cannot report zero failures.

Existing output lines are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:04:06 +01:00
Simon MaertensandClaude Opus 5 6d6643bdb5 CBLAS: report the data layout in the complex Level 2 verdicts
c_sblat2.f, c_dblat2.f and all four Level 3 drivers dispatch on IORDER
and report the column-major and row-major passes with distinct wording.
c_cblat2.f and c_zblat2.f never got that dispatch, so they print two
textually identical lines per routine:

     cblas_cgemv  PASSED THE COMPUTATIONAL TESTS (  3460 CALLS)
     cblas_cgemv  PASSED THE COMPUTATIONAL TESTS (  3460 CALLS)

There is no way to tell which layout a verdict belongs to, or to notice
that one of the two is missing. Add the dispatch, reusing the wording
and the 10000..10003 labels the other drivers already use. Those labels
also name the layout banner in the main program, which is fine: FORMAT
labels are local to a program unit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:04:02 +01:00
Simon Maertens f0b01be34a Ignore shared libraries and debugging info anywhere in the tree 2026-07-29 14:16:09 +02:00
Simon Maertens d270dac898 Apply const where possible. Use CBLAS_XERBLA_API_PREFIX instead of plain "cblas_" 2026-07-29 12:52:44 +02:00
Simon Maertens 745782750e Report the cblas routine in xerbla with the _64 suffix in extended API builds 2026-07-29 12:38:57 +02:00
Simon Maertens b22eed6a58 Fix indent 2026-07-29 11:24:08 +01:00
Simon Maertens 054422e6d3 Remove unnecessary comments in CMake 2026-07-29 11:24:07 +01:00
Simon MaertensandClaude Opus 5 c56597bfbf lapack_testing.py: analyze the BLAS test output
The BLAS tests run under both build systems but nothing reported on
them: the script knew only the LAPACK drivers and scanned only the
LAPACK testing directory.

Add the BLAS suite as its own library:

  - A test case per precision and BLAS level, with the Level 1 drivers
    marked as reading no input, and the Level 2 and 3 drivers marked as
    opening their own output file.
  - parse_blas, which takes run and failure counts from the driver's
    report lines. Computational failures are numerical errors and
    error-exit failures are other errors.
  - --blas-dir, defaulting to BLAS/TESTING. That relative path is
    correct from a CMake build root and from the source tree alike, so
    no existing invocation needs changing. A missing directory is
    skipped silently, since builds against an optimized BLAS have none.
  - --run support, which needs the input-less Level 1 drivers handled
    and the output redirection suppressed for Level 2 and 3. A _64 run
    of Level 2 or 3 requires the generated _64 input; without it the
    driver would write over the default-API output, so it is skipped
    with a message instead.

The drivers exit 0 even when they abandon a run, and print END OF TESTS
even when routines failed, so breakage is read from the text: an
abandoned or misconfigured run, and a Level 2 or 3 file that never
reached its footer, each count as one other error. Detail lines behind
an already counted verdict are shown but not counted, which otherwise
inflates a failing file several fold.

Output from a build whose drivers do not report counts is still
summarized, by counting one test per verdict. That is coarse, but never
silently zero.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 11:24:06 +01:00
Simon MaertensandClaude Opus 5 8bcfbf8d33 lapack_testing.py: report each library in its own summary section
The script is built around a single testing directory and a single set
of test families. Adding another test suite means teaching it that a
test case belongs to a library, that each library has its own directory,
and that each gets its own section of the summary table.

Introduce that structure without changing what is analyzed:

  - TestCase gains a library field, defaulting to LAPACK.
  - The testing directories are held in a per-library mapping, which
    read_output_file, run_test_case and the unrecognized-output scan now
    resolve through instead of assuming one directory.
  - find_unrecognized_outputs takes that mapping and matches each
    directory against only the cases of the library that owns it, so
    --fail-on-unrecognized stays accurate once more directories exist.
  - discover_suffixes takes the cases and directory of one library, so
    the extended API is detected per library rather than globally.
  - The summary loop iterates over (library, API) sections, and
    section_title names both.
  - -t gains a lapack value selecting all LAPACK families, so the
    previous default remains expressible once other libraries are added.

The only visible change is that section headings now read
"LAPACK: Default API" rather than "Default API". Analyzed output is
otherwise byte for byte identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 11:24:05 +01:00
Simon MaertensandClaude Opus 5 a3e6a89dd6 BLAS: capture the Level 1 test output in CMake builds
The Level 1 tests are registered with neither -DINPUT nor -DOUTPUT, so
xblat1s writes to stdout and the harness lets it go to the ctest log
only. No .out file is produced, and the four Level 1 results per
precision cannot be summarized after the fact.

Pass -DOUTPUT for the no-input branch, giving {s,d,c,z}blat1.out in the
testing binary directory. These are the names BLAS/TESTING/Makefile's
run target already produces, so both build systems now yield the same
set of files.

The Level 2 and 3 branch deliberately keeps no -DOUTPUT: those drivers
OPEN their own summary file on unit 6, and redirecting stdout onto the
same path would put two writers on one file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 11:24:04 +01:00
Simon MaertensandClaude Opus 5 9429724146 BLAS: count tests in the Level 1 drivers
The Level 1 testers print "----- PASS -----" or a bare FAIL per
subprogram, with no counts and no footer at all, so a summary tool can
only say which subprograms failed, not how much was checked. Report the
same line the Level 2 and 3 drivers now do:

     SDOT   COMPUTATIONAL TESTS:       16 RUN,        0 FAILED

One test is one element comparison in STEST, TESTDSDOT or ITEST1. CTEST
converts complex pairs and delegates to STEST, so it is not counted
separately.

The counters live in a new /CNTBLA/ block rather than in /COMBLA/,
because ?B1NRM2 takes N and INCX as arguments and could not declare
/COMBLA/ without a name collision. The subprogram name reaches the main
program from HEADER through /NAMBLA/, mirroring /SRNAMC/ in the Level 2
and 3 drivers.

?B1NRM2 failures never cleared PASS, so a case could print NRM2 failure
lines and "----- PASS -----" together. They are counted as failures,
which makes them visible for the first time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 11:24:04 +01:00
Simon MaertensandClaude Opus 5 ca1e0166df BLAS: count error-exit tests in the Level 2 and 3 drivers
?CHKE reports only a pass/fail verdict per routine, with no indication
of how many error exits it checked. Report those counts too, in the same
shape as the computational ones:

     SGEMV      ERROR-EXIT TESTS:        6 RUN,        0 FAILED

One test is one CHKXER call. CHKXER is called between 96 and 229 times
per driver, so threading counters through its argument list is not an
option; they travel in a new /XERCNT/ block instead, following the
/INFOC/ and /SRNAMC/ pattern these files already use.

A test fails in two distinct ways. Either the routine never called
XERBLA, which CHKXER already detects through LERR; or XERBLA was called
with the wrong INFO or the wrong routine name, which clears OK inside
XERBLA without CHKXER ever noticing. The second case is not theoretical:
it is what the extended API drivers hit, where the BLAS reports SRNAME
as CGEMV_ against an expected CGEMV. NXBAD carries that across so the
counts agree with the verdict instead of reporting zero failures beside
a FAILED line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 11:24:03 +01:00
Simon MaertensandClaude Opus 5 447a75e381 BLAS: count computational tests in the Level 2 and 3 drivers
The Level 2 and 3 testers report a per-routine verdict and a cumulative
count of BLAS calls, but never how many tests they ran or how many of
them failed. The call count is also absent from the hard-failure path,
so it shrinks exactly when something goes wrong, and nothing downstream
can tell a clean run from a broken one without reading the prose.

Each ?CHKn already computes a test ratio per accuracy check and compares
the worst of them against the threshold; it just discards the rest. Keep
NTESTS and NFAILS alongside the existing ERRMAX, incremented at the one
point where ERRMAX accumulates, and report them at the common exit so
the line appears on the PASSED, the COMPLETED/SUSPECT and the
FAILED ON CALL NUMBER paths alike:

     SGEMV      COMPUTATIONAL TESTS:     3456 RUN,        0 FAILED

A corrupted argument or a spurious error exit is not a threshold
failure, so those paths bump the counters where they set FATAL.
Otherwise a routine could abort and still report zero failures.

Every existing output line is unchanged; the report line is additive.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 11:23:58 +01:00
Simon Maertens 3cd79c329f Remove unnecessary (int) casts of info return values in CBLAS tests 2026-07-28 21:59:49 +02:00
Simon MaertensandClaude Opus 5 6c493e6508 CBLAS: add a clang-format configuration
Describes the style the xerbla sources are written in: three-space
indent, Allman braces, 80 columns, and the return type on its own line
for definitions. Every option clang-format knows about is listed, with
the ones inherited from the LLVM base style commented out, so that the
uncommented lines are exactly what this style changes.

The file applies to all of CBLAS, but the older sources here do not
follow it, so format only the lines you touch, e.g. with
git clang-format.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:35:14 +02:00
Simon MaertensandClaude Opus 5 e2fd85389f CBLAS: use the shared XERBLA helper in the xerbla sources
Switch cblas_xerbla(), F77_xerbla_base() and the test harness over to
cblas_xerbla_internal.h. Two diagnostic bugs go away with the duplicated
code:

  - the row-major remap keyed off strstr(rout, "gemm"), which also
    matches gemmtr and so wrongly swapped its arguments 4 and 5;

  - the six-character name buffer truncated cblas_sgemmtr and
    cblas_sskewsyr2k in the library, while the harness used an
    eleven-character buffer and did not, so the two disagreed about the
    same routine.

The Fortran entry points now take FCHAR and read the argument number
through F77_INT consistently, honour the hidden string length instead of
assuming six characters, and carry doxygen comments.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:35:14 +02:00
Simon MaertensandClaude Opus 5 bfadf61f2f CBLAS: add a shared helper header for XERBLA name and INFO handling
cblas_xerbla_internal.h collects the routine-name construction and the
row-major INFO remapping that the library and the test harness each
open-code today, so the two copies can no longer drift apart.

Relative to those copies the helper also trims the blank padding Fortran
supplies, drops the _64 suffix that BUILD_INDEX64_EXT_API rewrites into
the XERBLA name literals, matches operation names exactly rather than by
substring, and derives its buffer size from a named maximum so that long
names are clamped instead of silently truncated.

It has no user yet; the xerbla sources are switched over next.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:35:13 +02:00
Simon MaertensandClaude Opus 5 2ba64b0003 CBLAS: provide F77_INT and FCHAR to the testing headers
c_xerbla.c needs the Fortran integer and character types to declare
F77_xerbla(), but the testing sources deliberately do not include
cblas_f77.h: that header maps every F77_* name to the real BLAS symbol
while cblas_test.h maps them to the Fortran test wrappers, and 141 of
those names collide.

Copy the two fallbacks into cblas_test.h instead, alongside the
BLAS_FORTRAN_STRLEN_END and FORTRAN_STRLEN definitions it already
duplicates for the same reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:35:13 +02:00
Simon MaertensandClaude Opus 5 58cff20b27 CBLAS: add CBLAS_WEAK_SYMBOL and use it for the xerbla declarations
Replace the repeated

    void
    #ifdef HAS_ATTRIBUTE_WEAK_SUPPORT
    __attribute__((weak))
    #endif

preamble on the cblas_xerbla(), cblas_xerbla_64() and F77_xerbla_base()
declarations with a single CBLAS_WEAK_SYMBOL macro.

Define it in cblas.h ahead of the cblas_64.h include: cblas_64.h declares
cblas_xerbla_64() with the macro, and its own include of cblas.h is a
no-op while cblas.h is still inside its own include guard.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:35:08 +02:00
langou 6737170823 Merge pull request #1338 from ACSimon33/fix-chkbl-missing-abs
Fix SGEBAL test failure
2026-07-28 13:09:44 -06:00
langou e2a3ec48ec Merge pull request #1337 from ACSimon33/cblas_rowmajor_error_exits
CBLAS: fix & enhance error handling for row-major layout
2026-07-28 10:54:03 -06:00
Simon MaertensandClaude Fable 5 f754f09454 CBLAS: reject invalid Trans values in row-major complex rank-k updates
The row-major branches of cherk/zherk and cher2k/zher2k mapped the
invalid CblasTrans to 'N', and those of csyrk/zsyrk and csyr2k/zsyr2k
mapped the invalid CblasConjTrans to 'N', silently computing a
different operation instead of rejecting the argument. The
column-major branches forward these values to the Fortran routine,
which reports them as an illegal second argument (parameter 3 of the
CBLAS call). Drop the bogus mappings so the invalid values reach the
row-major branches' existing error exits, which also report
parameter 3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 15:46:52 +02:00
Simon Maertens c749e19a2f CBLAS: correct row-major error diagnostics 2026-07-28 15:46:51 +02:00
Simon MaertensandClaude Fable 5 cf265acf5a CBLAS: test error exits under row-major layout
The error-exit testers only exercised the option arguments (Side,
Uplo, Trans, Diag) with CblasColMajor, so the diagnostics in the
row-major branches of the level-3 routines were never tested. Mirror
every column-major option-argument test under CblasRowMajor, add the
missing row-major N/K dimension tests for the syrk/herk/syr2k/her2k/
skewsyr2k families, turn the duplicated column-major blocks in the
spr/hpr sections into the intended row-major tests, and make the
mislabelled gemmtr ldb "row major" tests actually use CblasRowMajor.

The new tests expose wrong INFO values in the row-major branches of
cgemm (TransB) and the syrk/syr2k/herk/skewsyr2k families (Uplo), and
silently accepted invalid Trans values in the row-major branches of
the complex herk/her2k/syrk/syr2k routines; these are fixed in the
following commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 15:46:28 +02:00
Simon MaertensandClaude Fable 5 01218ae45d Add missing ABS in the error metric of schkbl/dchkbl
The relative-error denominator used MAX(A(I,J), AIN(I,J)) without
taking absolute values. For entries where both matrices are negative,
the subsequent clamp replaced the denominator with SFMIN, and the
difference divided by SFMIN overflowed to Infinity in single precision
(sbal.in example 11). The complex checkers already use CABS1 here.

sbal now reports the same finite largest error (0.100E+01, example 5)
as the other three precisions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 15:05:18 +02:00
langou cea993b201 Merge pull request #1336 from ACSimon33/lapack_testing_script_modernization
Modernize lapack_testing.py script
2026-07-26 19:10:27 -06:00
Simon Maertens 1fdd793af9 Comsolidated LIN test family 2026-07-27 00:05:42 +02:00
Simon Maertens b730744392 Refactor lapack_testing.py script, to fix several shortcomings and moderize the script as a whole 2026-07-26 18:47:05 +02:00
langou 7a7d7453ed Merge pull request #1334 from ACSimon33/windows_shared_lib_intelllvm
Fix shared LAPACKE library build on Windows with IntelLLVM compilers
2026-07-23 10:01:04 -06:00
langou d8b427ad63 Merge pull request #1335 from ACSimon33/windows_ci
Update Windows CI
2026-07-23 09:59:37 -06:00
Simon Maertens 467bb93f7e Split Windows CI job into 2 jobs (defaul API and extended API) to reduce the build time per job 2026-07-23 15:25:19 +01:00