Skip to content

Commit d43e071

Browse files
authored
Merge pull request #3208 from martin-frbg/lapack534
Apply MKL team fixes to the LAPACKE interfaces (Reference-LAPACK PR 534)
2 parents da16764 + 5cc35ab commit d43e071

File tree

77 files changed

+105
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+105
-121
lines changed

lapack-netlib/LAPACKE/include/lapack.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,15 +4768,15 @@ void LAPACK_chegst(
47684768
lapack_int const* itype, char const* uplo,
47694769
lapack_int const* n,
47704770
lapack_complex_float* A, lapack_int const* lda,
4771-
lapack_complex_float* B, lapack_int const* ldb,
4771+
const lapack_complex_float* B, lapack_int const* ldb,
47724772
lapack_int* info );
47734773

47744774
#define LAPACK_zhegst LAPACK_GLOBAL(zhegst,ZHEGST)
47754775
void LAPACK_zhegst(
47764776
lapack_int const* itype, char const* uplo,
47774777
lapack_int const* n,
47784778
lapack_complex_double* A, lapack_int const* lda,
4779-
lapack_complex_double* B, lapack_int const* ldb,
4779+
const lapack_complex_double* B, lapack_int const* ldb,
47804780
lapack_int* info );
47814781

47824782
#define LAPACK_chegv LAPACK_GLOBAL(chegv,CHEGV)
@@ -11556,7 +11556,7 @@ void LAPACK_zsytrs(
1155611556
void LAPACK_csytrs2(
1155711557
char const* uplo,
1155811558
lapack_int const* n, lapack_int const* nrhs,
11559-
lapack_complex_float* A, lapack_int const* lda, lapack_int const* ipiv,
11559+
const lapack_complex_float* A, lapack_int const* lda, lapack_int const* ipiv,
1156011560
lapack_complex_float* B, lapack_int const* ldb,
1156111561
lapack_complex_float* work,
1156211562
lapack_int* info );
@@ -11565,7 +11565,7 @@ void LAPACK_csytrs2(
1156511565
void LAPACK_dsytrs2(
1156611566
char const* uplo,
1156711567
lapack_int const* n, lapack_int const* nrhs,
11568-
double* A, lapack_int const* lda, lapack_int const* ipiv,
11568+
const double* A, lapack_int const* lda, lapack_int const* ipiv,
1156911569
double* B, lapack_int const* ldb,
1157011570
double* work,
1157111571
lapack_int* info );
@@ -11574,7 +11574,7 @@ void LAPACK_dsytrs2(
1157411574
void LAPACK_ssytrs2(
1157511575
char const* uplo,
1157611576
lapack_int const* n, lapack_int const* nrhs,
11577-
float* A, lapack_int const* lda, lapack_int const* ipiv,
11577+
const float* A, lapack_int const* lda, lapack_int const* ipiv,
1157811578
float* B, lapack_int const* ldb,
1157911579
float* work,
1158011580
lapack_int* info );
@@ -11583,7 +11583,7 @@ void LAPACK_ssytrs2(
1158311583
void LAPACK_zsytrs2(
1158411584
char const* uplo,
1158511585
lapack_int const* n, lapack_int const* nrhs,
11586-
lapack_complex_double* A, lapack_int const* lda, lapack_int const* ipiv,
11586+
const lapack_complex_double* A, lapack_int const* lda, lapack_int const* ipiv,
1158711587
lapack_complex_double* B, lapack_int const* ldb,
1158811588
lapack_complex_double* work,
1158911589
lapack_int* info );

lapack-netlib/LAPACKE/include/lapacke.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,11 +1867,11 @@ lapack_int LAPACKE_zheevx( int matrix_layout, char jobz, char range, char uplo,
18671867

18681868
lapack_int LAPACKE_chegst( int matrix_layout, lapack_int itype, char uplo,
18691869
lapack_int n, lapack_complex_float* a,
1870-
lapack_int lda, lapack_complex_float* b,
1870+
lapack_int lda, const lapack_complex_float* b,
18711871
lapack_int ldb );
18721872
lapack_int LAPACKE_zhegst( int matrix_layout, lapack_int itype, char uplo,
18731873
lapack_int n, lapack_complex_double* a,
1874-
lapack_int lda, lapack_complex_double* b,
1874+
lapack_int lda, const lapack_complex_double* b,
18751875
lapack_int ldb );
18761876

18771877
lapack_int LAPACKE_chegv( int matrix_layout, lapack_int itype, char jobz,
@@ -6932,11 +6932,11 @@ lapack_int LAPACKE_zheevx_work( int matrix_layout, char jobz, char range,
69326932

69336933
lapack_int LAPACKE_chegst_work( int matrix_layout, lapack_int itype, char uplo,
69346934
lapack_int n, lapack_complex_float* a,
6935-
lapack_int lda, lapack_complex_float* b,
6935+
lapack_int lda, const lapack_complex_float* b,
69366936
lapack_int ldb );
69376937
lapack_int LAPACKE_zhegst_work( int matrix_layout, lapack_int itype, char uplo,
69386938
lapack_int n, lapack_complex_double* a,
6939-
lapack_int lda, lapack_complex_double* b,
6939+
lapack_int lda, const lapack_complex_double* b,
69406940
lapack_int ldb );
69416941

69426942
lapack_int LAPACKE_chegv_work( int matrix_layout, lapack_int itype, char jobz,
@@ -10553,11 +10553,11 @@ lapack_int LAPACKE_csytri2x_work( int matrix_layout, char uplo, lapack_int n,
1055310553
const lapack_int* ipiv,
1055410554
lapack_complex_float* work, lapack_int nb );
1055510555
lapack_int LAPACKE_csytrs2( int matrix_layout, char uplo, lapack_int n,
10556-
lapack_int nrhs, lapack_complex_float* a,
10556+
lapack_int nrhs, const lapack_complex_float* a,
1055710557
lapack_int lda, const lapack_int* ipiv,
1055810558
lapack_complex_float* b, lapack_int ldb );
1055910559
lapack_int LAPACKE_csytrs2_work( int matrix_layout, char uplo, lapack_int n,
10560-
lapack_int nrhs, lapack_complex_float* a,
10560+
lapack_int nrhs, const lapack_complex_float* a,
1056110561
lapack_int lda, const lapack_int* ipiv,
1056210562
lapack_complex_float* b, lapack_int ldb,
1056310563
lapack_complex_float* work );
@@ -10718,10 +10718,10 @@ lapack_int LAPACKE_dsytri2x_work( int matrix_layout, char uplo, lapack_int n,
1071810718
const lapack_int* ipiv, double* work,
1071910719
lapack_int nb );
1072010720
lapack_int LAPACKE_dsytrs2( int matrix_layout, char uplo, lapack_int n,
10721-
lapack_int nrhs, double* a, lapack_int lda,
10721+
lapack_int nrhs, const double* a, lapack_int lda,
1072210722
const lapack_int* ipiv, double* b, lapack_int ldb );
1072310723
lapack_int LAPACKE_dsytrs2_work( int matrix_layout, char uplo, lapack_int n,
10724-
lapack_int nrhs, double* a,
10724+
lapack_int nrhs, const double* a,
1072510725
lapack_int lda, const lapack_int* ipiv,
1072610726
double* b, lapack_int ldb, double* work );
1072710727
lapack_int LAPACKE_sbbcsd( int matrix_layout, char jobu1, char jobu2,
@@ -10813,10 +10813,10 @@ lapack_int LAPACKE_ssytri2x_work( int matrix_layout, char uplo, lapack_int n,
1081310813
const lapack_int* ipiv, float* work,
1081410814
lapack_int nb );
1081510815
lapack_int LAPACKE_ssytrs2( int matrix_layout, char uplo, lapack_int n,
10816-
lapack_int nrhs, float* a, lapack_int lda,
10816+
lapack_int nrhs, const float* a, lapack_int lda,
1081710817
const lapack_int* ipiv, float* b, lapack_int ldb );
1081810818
lapack_int LAPACKE_ssytrs2_work( int matrix_layout, char uplo, lapack_int n,
10819-
lapack_int nrhs, float* a,
10819+
lapack_int nrhs, const float* a,
1082010820
lapack_int lda, const lapack_int* ipiv,
1082110821
float* b, lapack_int ldb, float* work );
1082210822
lapack_int LAPACKE_zbbcsd( int matrix_layout, char jobu1, char jobu2,
@@ -10898,11 +10898,11 @@ lapack_int LAPACKE_zsytri2x_work( int matrix_layout, char uplo, lapack_int n,
1089810898
const lapack_int* ipiv,
1089910899
lapack_complex_double* work, lapack_int nb );
1090010900
lapack_int LAPACKE_zsytrs2( int matrix_layout, char uplo, lapack_int n,
10901-
lapack_int nrhs, lapack_complex_double* a,
10901+
lapack_int nrhs, const lapack_complex_double* a,
1090210902
lapack_int lda, const lapack_int* ipiv,
1090310903
lapack_complex_double* b, lapack_int ldb );
1090410904
lapack_int LAPACKE_zsytrs2_work( int matrix_layout, char uplo, lapack_int n,
10905-
lapack_int nrhs, lapack_complex_double* a,
10905+
lapack_int nrhs, const lapack_complex_double* a,
1090610906
lapack_int lda, const lapack_int* ipiv,
1090710907
lapack_complex_double* b, lapack_int ldb,
1090810908
lapack_complex_double* work );

lapack-netlib/LAPACKE/src/lapacke_cgesvd_work.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ lapack_int LAPACKE_cgesvd_work( int matrix_layout, char jobu, char jobvt,
5656
( LAPACKE_lsame( jobu, 's' ) ? MIN(m,n) : 1);
5757
lapack_int nrows_vt = LAPACKE_lsame( jobvt, 'a' ) ? n :
5858
( LAPACKE_lsame( jobvt, 's' ) ? MIN(m,n) : 1);
59+
lapack_int ncols_vt = ( LAPACKE_lsame( jobvt, 'a' ) ||
60+
LAPACKE_lsame( jobvt, 's' ) ) ? n : 1;
5961
lapack_int lda_t = MAX(1,m);
6062
lapack_int ldu_t = MAX(1,nrows_u);
6163
lapack_int ldvt_t = MAX(1,nrows_vt);
@@ -73,7 +75,7 @@ lapack_int LAPACKE_cgesvd_work( int matrix_layout, char jobu, char jobvt,
7375
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
7476
return info;
7577
}
76-
if( ldvt < n ) {
78+
if( ldvt < ncols_vt ) {
7779
info = -12;
7880
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
7981
return info;

lapack-netlib/LAPACKE/src/lapacke_cheev_work.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ lapack_int LAPACKE_cheev_work( int matrix_layout, char jobz, char uplo,
7878
info = info - 1;
7979
}
8080
/* Transpose output matrices */
81-
if ( jobz == 'V') {
81+
if ( jobz == 'V' || jobz == 'v' ) {
8282
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
8383
} else {
8484
LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );

lapack-netlib/LAPACKE/src/lapacke_cheevd_2stage_work.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ lapack_int LAPACKE_cheevd_2stage_work( int matrix_layout, char jobz, char uplo,
7979
info = info - 1;
8080
}
8181
/* Transpose output matrices */
82-
if ( jobz == 'V') {
82+
if ( jobz == 'V' || jobz == 'v' ) {
8383
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
8484
} else {
8585
LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );

lapack-netlib/LAPACKE/src/lapacke_cheevd_work.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ lapack_int LAPACKE_cheevd_work( int matrix_layout, char jobz, char uplo,
7979
info = info - 1;
8080
}
8181
/* Transpose output matrices */
82-
if ( jobz == 'V') {
82+
if ( jobz == 'V' || jobz == 'v' ) {
8383
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
8484
} else {
8585
LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );

lapack-netlib/LAPACKE/src/lapacke_chegst.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
lapack_int LAPACKE_chegst( int matrix_layout, lapack_int itype, char uplo,
3737
lapack_int n, lapack_complex_float* a,
38-
lapack_int lda, lapack_complex_float* b,
38+
lapack_int lda, const lapack_complex_float* b,
3939
lapack_int ldb )
4040
{
4141
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {

lapack-netlib/LAPACKE/src/lapacke_chegst_work.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
lapack_int LAPACKE_chegst_work( int matrix_layout, lapack_int itype, char uplo,
3737
lapack_int n, lapack_complex_float* a,
38-
lapack_int lda, lapack_complex_float* b,
38+
lapack_int lda, const lapack_complex_float* b,
3939
lapack_int ldb )
4040
{
4141
lapack_int info = 0;

lapack-netlib/LAPACKE/src/lapacke_chegv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ lapack_int LAPACKE_chegv( int matrix_layout, lapack_int itype, char jobz,
5050
#ifndef LAPACK_DISABLE_NAN_CHECK
5151
if( LAPACKE_get_nancheck() ) {
5252
/* Optionally check input matrices for NaNs */
53-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
53+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, a, lda ) ) {
5454
return -6;
5555
}
56-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, b, ldb ) ) {
56+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, b, ldb ) ) {
5757
return -8;
5858
}
5959
}

lapack-netlib/LAPACKE/src/lapacke_chegv_2stage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ lapack_int LAPACKE_chegv_2stage( int matrix_layout, lapack_int itype, char jobz,
5050
#ifndef LAPACK_DISABLE_NAN_CHECK
5151
if( LAPACKE_get_nancheck() ) {
5252
/* Optionally check input matrices for NaNs */
53-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
53+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, a, lda ) ) {
5454
return -6;
5555
}
56-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, b, ldb ) ) {
56+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, b, ldb ) ) {
5757
return -8;
5858
}
5959
}

0 commit comments

Comments
 (0)