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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
?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>
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>
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>
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>
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>
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>
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>
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>
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>
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>