Skip to content

CBLAS: fix & enhance error handling for row-major layout - #1337

Merged
langou merged 3 commits into
Reference-LAPACK:masterfrom
ACSimon33:cblas_rowmajor_error_exits
Jul 28, 2026
Merged

langou merged 3 commits into
Reference-LAPACK:masterfrom
ACSimon33:cblas_rowmajor_error_exits

Conversation

@ACSimon33

@ACSimon33 ACSimon33 commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The CBLAS error-exit testers never exercised the option arguments (Side, Uplo, Trans, Diag) of the level-3 routines with CblasRowMajor, so the diagnostics in the row-major branches were untested. This PR:

  • Adds row-major error-exit tests: every column-major option-argument test now has a CblasRowMajor twin; the syrk/herk/syr2k/her2k/skewsyr2k families gain the missing row-major N/K tests; the gemmtr ldb "row major" tests now actually use CblasRowMajor; and the spr/hpr sections' accidentally duplicated column-major blocks become the intended row-major tests.
  • Fixes wrong diagnostics the new tests flag: cblas_cgemm reported an illegal TransB as parameter 2 instead of 3, and the syrk/syr2k/herk/skewsyr2k families reported an illegal Uplo as parameter 3 instead of 2 (row-major branches only). The tbmv routines also printed "Illegal Uplo setting" for an illegal Diag.
  • Fixes silently accepted invalid Trans values: the row-major branches of {c,z}herk/{c,z}her2k mapped the invalid CblasTrans, and {c,z}syrk/{c,z}syr2k the invalid CblasConjTrans, onto 'N' and computed the wrong operation without any error. They now reach the existing error exit (parameter 3), matching the column-major
    behavior, where the Fortran routine rejects the forwarded value.

ACSimon33 and others added 3 commits July 28, 2026 15:46
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 <[email protected]>
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 <[email protected]>
Copilot AI review requested due to automatic review settings July 28, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@langou
langou merged commit e2a3ec4 into Reference-LAPACK:master Jul 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants