Repository navigation
CBLAS: fix & enhance error handling for row-major layout - #1337
Merged
langou merged 3 commits intoJul 28, 2026
Merged
Conversation
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]>
langou
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The CBLAS error-exit testers never exercised the option arguments (
Side,Uplo,Trans,Diag) of the level-3 routines withCblasRowMajor, so the diagnostics in the row-major branches were untested. This PR:CblasRowMajortwin; the syrk/herk/syr2k/her2k/skewsyr2k families gain the missing row-majorN/Ktests; the gemmtr ldb "row major" tests now actually useCblasRowMajor; and the spr/hpr sections' accidentally duplicated column-major blocks become the intended row-major tests.cblas_cgemmreported an illegalTransBas parameter 2 instead of 3, and the syrk/syr2k/herk/skewsyr2k families reported an illegalUploas parameter 3 instead of 2 (row-major branches only). The tbmv routines also printed "Illegal Uplo setting" for an illegalDiag.Transvalues: the row-major branches of{c,z}herk/{c,z}her2kmapped the invalidCblasTrans, and{c,z}syrk/{c,z}syr2kthe invalidCblasConjTrans, onto'N'and computed the wrong operation without any error. They now reach the existing error exit (parameter 3), matching the column-majorbehavior, where the Fortran routine rejects the forwarded value.