Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overly restrictive argument checking in LAPACKE_?gesvd #1090

Open
2 tasks done
martin-frbg opened this issue Jan 6, 2025 · 1 comment
Open
2 tasks done

Overly restrictive argument checking in LAPACKE_?gesvd #1090

martin-frbg opened this issue Jan 6, 2025 · 1 comment

Comments

@martin-frbg
Copy link
Collaborator

Description
As pointed out by Gonum's Dan Kortschak in OpenMathLib/OpenBLAS#5051 , the LAPACKE bindings for the GESVD functions appear to be overly restrictive in the LDVT argument check performed on row-major calls:
When the JOBVT argument is "N" and consequently the output matrix "VT" will not be referenced at all according to the provided documentation, the current code still insists on a nonzero LDVT, taking the INFO=12 error exit instead of providing a work size estimate in LAPACKE_?gesvd_work.c

It occurs to me that the code in e.g.

if( ldvt < ncols_vt ) {

should be conditional on if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {

Checklist

  • I've included a minimal example to reproduce the issue (see in referenced OpenBLAS ticket)
  • I'd be willing to make a PR to solve this issue
@martin-frbg
Copy link
Collaborator Author

(A minimal fix would be to change the preceding ternary operator that sets the minimum ncols_vt so that it is zero (like in the corresponding lapacke_?gesvdx_work functions) instead of one - however I see no requirement that this entirely unused value cannot be negative)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant