Skip to content

Fix too strict leading dimension check on LAPACKE_?gesdd_work #1126

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion LAPACKE/src/lapacke_cgesdd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ lapack_int API_SUFFIX(LAPACKE_cgesdd_work)( int matrix_layout, char jobz, lapack
lapack_int nrows_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n :
( API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ? MIN(m,n) : 1);
lapack_int ncols_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n : 1;
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldvt_t = MAX(1,nrows_vt);
Expand All @@ -75,7 +78,7 @@ lapack_int API_SUFFIX(LAPACKE_cgesdd_work)( int matrix_layout, char jobz, lapack
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgesdd_work", info );
return info;
}
if( ldvt < n ) {
if( ldvt < ncols_vt ) {
info = -11;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_cgesdd_work", info );
return info;
Expand Down
5 changes: 4 additions & 1 deletion LAPACKE/src/lapacke_dgesdd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ lapack_int API_SUFFIX(LAPACKE_dgesdd_work)( int matrix_layout, char jobz, lapack
lapack_int nrows_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n :
( API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ? MIN(m,n) : 1);
lapack_int ncols_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n : 1;
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldvt_t = MAX(1,nrows_vt);
Expand All @@ -73,7 +76,7 @@ lapack_int API_SUFFIX(LAPACKE_dgesdd_work)( int matrix_layout, char jobz, lapack
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dgesdd_work", info );
return info;
}
if( ldvt < n ) {
if( ldvt < ncols_vt ) {
info = -11;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dgesdd_work", info );
return info;
Expand Down
5 changes: 4 additions & 1 deletion LAPACKE/src/lapacke_sgesdd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ lapack_int API_SUFFIX(LAPACKE_sgesdd_work)( int matrix_layout, char jobz, lapack
lapack_int nrows_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n :
( API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ? MIN(m,n) : 1);
lapack_int ncols_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n : 1;
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldvt_t = MAX(1,nrows_vt);
Expand All @@ -73,7 +76,7 @@ lapack_int API_SUFFIX(LAPACKE_sgesdd_work)( int matrix_layout, char jobz, lapack
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_sgesdd_work", info );
return info;
}
if( ldvt < n ) {
if( ldvt < ncols_vt ) {
info = -11;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_sgesdd_work", info );
return info;
Expand Down
5 changes: 4 additions & 1 deletion LAPACKE/src/lapacke_zgesdd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ lapack_int API_SUFFIX(LAPACKE_zgesdd_work)( int matrix_layout, char jobz, lapack
lapack_int nrows_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n :
( API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ? MIN(m,n) : 1);
lapack_int ncols_vt = ( API_SUFFIX(LAPACKE_lsame)( jobz, 'a' ) ||
API_SUFFIX(LAPACKE_lsame)( jobz, 's' ) ||
( API_SUFFIX(LAPACKE_lsame)( jobz, 'o' ) && m>=n) ) ? n : 1;
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldvt_t = MAX(1,nrows_vt);
Expand All @@ -75,7 +78,7 @@ lapack_int API_SUFFIX(LAPACKE_zgesdd_work)( int matrix_layout, char jobz, lapack
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zgesdd_work", info );
return info;
}
if( ldvt < n ) {
if( ldvt < ncols_vt ) {
info = -11;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zgesdd_work", info );
return info;
Expand Down