Skip to content

Commit 30c9450

Browse files
Merge pull request #534 from sergey-v-kuznetsov/LAPACKE_fixes_from_MKL
Fixes from MKL team in LAPACKE interfaces thanks to @sergey-v-kuznetsov.
2 parents 2614d23 + 4e693fe commit 30c9450

File tree

77 files changed

+182
-123
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

+182
-123
lines changed

LAPACKE/include/lapack.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,15 +4819,15 @@ void LAPACK_chegst(
48194819
lapack_int const* itype, char const* uplo,
48204820
lapack_int const* n,
48214821
lapack_complex_float* A, lapack_int const* lda,
4822-
lapack_complex_float* B, lapack_int const* ldb,
4822+
const lapack_complex_float* B, lapack_int const* ldb,
48234823
lapack_int* info );
48244824

48254825
#define LAPACK_zhegst LAPACK_GLOBAL(zhegst,ZHEGST)
48264826
void LAPACK_zhegst(
48274827
lapack_int const* itype, char const* uplo,
48284828
lapack_int const* n,
48294829
lapack_complex_double* A, lapack_int const* lda,
4830-
lapack_complex_double* B, lapack_int const* ldb,
4830+
const lapack_complex_double* B, lapack_int const* ldb,
48314831
lapack_int* info );
48324832

48334833
#define LAPACK_chegv LAPACK_GLOBAL(chegv,CHEGV)
@@ -11625,7 +11625,7 @@ void LAPACK_zsytrs(
1162511625
void LAPACK_csytrs2(
1162611626
char const* uplo,
1162711627
lapack_int const* n, lapack_int const* nrhs,
11628-
lapack_complex_float* A, lapack_int const* lda, lapack_int const* ipiv,
11628+
const lapack_complex_float* A, lapack_int const* lda, lapack_int const* ipiv,
1162911629
lapack_complex_float* B, lapack_int const* ldb,
1163011630
lapack_complex_float* work,
1163111631
lapack_int* info );
@@ -11634,7 +11634,7 @@ void LAPACK_csytrs2(
1163411634
void LAPACK_dsytrs2(
1163511635
char const* uplo,
1163611636
lapack_int const* n, lapack_int const* nrhs,
11637-
double* A, lapack_int const* lda, lapack_int const* ipiv,
11637+
const double* A, lapack_int const* lda, lapack_int const* ipiv,
1163811638
double* B, lapack_int const* ldb,
1163911639
double* work,
1164011640
lapack_int* info );
@@ -11643,7 +11643,7 @@ void LAPACK_dsytrs2(
1164311643
void LAPACK_ssytrs2(
1164411644
char const* uplo,
1164511645
lapack_int const* n, lapack_int const* nrhs,
11646-
float* A, lapack_int const* lda, lapack_int const* ipiv,
11646+
const float* A, lapack_int const* lda, lapack_int const* ipiv,
1164711647
float* B, lapack_int const* ldb,
1164811648
float* work,
1164911649
lapack_int* info );
@@ -11652,7 +11652,7 @@ void LAPACK_ssytrs2(
1165211652
void LAPACK_zsytrs2(
1165311653
char const* uplo,
1165411654
lapack_int const* n, lapack_int const* nrhs,
11655-
lapack_complex_double* A, lapack_int const* lda, lapack_int const* ipiv,
11655+
const lapack_complex_double* A, lapack_int const* lda, lapack_int const* ipiv,
1165611656
lapack_complex_double* B, lapack_int const* ldb,
1165711657
lapack_complex_double* work,
1165811658
lapack_int* info );

LAPACKE/include/lapacke.h

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

18671867
lapack_int LAPACKE_chegst( int matrix_layout, lapack_int itype, char uplo,
18681868
lapack_int n, lapack_complex_float* a,
1869-
lapack_int lda, lapack_complex_float* b,
1869+
lapack_int lda, const lapack_complex_float* b,
18701870
lapack_int ldb );
18711871
lapack_int LAPACKE_zhegst( int matrix_layout, lapack_int itype, char uplo,
18721872
lapack_int n, lapack_complex_double* a,
1873-
lapack_int lda, lapack_complex_double* b,
1873+
lapack_int lda, const lapack_complex_double* b,
18741874
lapack_int ldb );
18751875

18761876
lapack_int LAPACKE_chegv( int matrix_layout, lapack_int itype, char jobz,
@@ -6949,11 +6949,11 @@ lapack_int LAPACKE_zheevx_work( int matrix_layout, char jobz, char range,
69496949

69506950
lapack_int LAPACKE_chegst_work( int matrix_layout, lapack_int itype, char uplo,
69516951
lapack_int n, lapack_complex_float* a,
6952-
lapack_int lda, lapack_complex_float* b,
6952+
lapack_int lda, const lapack_complex_float* b,
69536953
lapack_int ldb );
69546954
lapack_int LAPACKE_zhegst_work( int matrix_layout, lapack_int itype, char uplo,
69556955
lapack_int n, lapack_complex_double* a,
6956-
lapack_int lda, lapack_complex_double* b,
6956+
lapack_int lda, const lapack_complex_double* b,
69576957
lapack_int ldb );
69586958

69596959
lapack_int LAPACKE_chegv_work( int matrix_layout, lapack_int itype, char jobz,
@@ -10596,11 +10596,11 @@ lapack_int LAPACKE_csytri2x_work( int matrix_layout, char uplo, lapack_int n,
1059610596
const lapack_int* ipiv,
1059710597
lapack_complex_float* work, lapack_int nb );
1059810598
lapack_int LAPACKE_csytrs2( int matrix_layout, char uplo, lapack_int n,
10599-
lapack_int nrhs, lapack_complex_float* a,
10599+
lapack_int nrhs, const lapack_complex_float* a,
1060010600
lapack_int lda, const lapack_int* ipiv,
1060110601
lapack_complex_float* b, lapack_int ldb );
1060210602
lapack_int LAPACKE_csytrs2_work( int matrix_layout, char uplo, lapack_int n,
10603-
lapack_int nrhs, lapack_complex_float* a,
10603+
lapack_int nrhs, const lapack_complex_float* a,
1060410604
lapack_int lda, const lapack_int* ipiv,
1060510605
lapack_complex_float* b, lapack_int ldb,
1060610606
lapack_complex_float* work );
@@ -10761,10 +10761,10 @@ lapack_int LAPACKE_dsytri2x_work( int matrix_layout, char uplo, lapack_int n,
1076110761
const lapack_int* ipiv, double* work,
1076210762
lapack_int nb );
1076310763
lapack_int LAPACKE_dsytrs2( int matrix_layout, char uplo, lapack_int n,
10764-
lapack_int nrhs, double* a, lapack_int lda,
10764+
lapack_int nrhs, const double* a, lapack_int lda,
1076510765
const lapack_int* ipiv, double* b, lapack_int ldb );
1076610766
lapack_int LAPACKE_dsytrs2_work( int matrix_layout, char uplo, lapack_int n,
10767-
lapack_int nrhs, double* a,
10767+
lapack_int nrhs, const double* a,
1076810768
lapack_int lda, const lapack_int* ipiv,
1076910769
double* b, lapack_int ldb, double* work );
1077010770
lapack_int LAPACKE_sbbcsd( int matrix_layout, char jobu1, char jobu2,
@@ -10856,10 +10856,10 @@ lapack_int LAPACKE_ssytri2x_work( int matrix_layout, char uplo, lapack_int n,
1085610856
const lapack_int* ipiv, float* work,
1085710857
lapack_int nb );
1085810858
lapack_int LAPACKE_ssytrs2( int matrix_layout, char uplo, lapack_int n,
10859-
lapack_int nrhs, float* a, lapack_int lda,
10859+
lapack_int nrhs, const float* a, lapack_int lda,
1086010860
const lapack_int* ipiv, float* b, lapack_int ldb );
1086110861
lapack_int LAPACKE_ssytrs2_work( int matrix_layout, char uplo, lapack_int n,
10862-
lapack_int nrhs, float* a,
10862+
lapack_int nrhs, const float* a,
1086310863
lapack_int lda, const lapack_int* ipiv,
1086410864
float* b, lapack_int ldb, float* work );
1086510865
lapack_int LAPACKE_zbbcsd( int matrix_layout, char jobu1, char jobu2,
@@ -10941,11 +10941,11 @@ lapack_int LAPACKE_zsytri2x_work( int matrix_layout, char uplo, lapack_int n,
1094110941
const lapack_int* ipiv,
1094210942
lapack_complex_double* work, lapack_int nb );
1094310943
lapack_int LAPACKE_zsytrs2( int matrix_layout, char uplo, lapack_int n,
10944-
lapack_int nrhs, lapack_complex_double* a,
10944+
lapack_int nrhs, const lapack_complex_double* a,
1094510945
lapack_int lda, const lapack_int* ipiv,
1094610946
lapack_complex_double* b, lapack_int ldb );
1094710947
lapack_int LAPACKE_zsytrs2_work( int matrix_layout, char uplo, lapack_int n,
10948-
lapack_int nrhs, lapack_complex_double* a,
10948+
lapack_int nrhs, const lapack_complex_double* a,
1094910949
lapack_int lda, const lapack_int* ipiv,
1095010950
lapack_complex_double* b, lapack_int ldb,
1095110951
lapack_complex_double* work );

LAPACKE/src/lapacke_cgesvd_work.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*****************************************************************************
2929
* Contents: Native middle-level C interface to LAPACK function cgesvd
3030
* Author: Intel Corporation
31+
* Generated November 2015
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
@@ -55,6 +56,8 @@ lapack_int LAPACKE_cgesvd_work( int matrix_layout, char jobu, char jobvt,
5556
( LAPACKE_lsame( jobu, 's' ) ? MIN(m,n) : 1);
5657
lapack_int nrows_vt = LAPACKE_lsame( jobvt, 'a' ) ? n :
5758
( LAPACKE_lsame( jobvt, 's' ) ? MIN(m,n) : 1);
59+
lapack_int ncols_vt = ( LAPACKE_lsame( jobvt, 'a' ) ||
60+
LAPACKE_lsame( jobvt, 's' ) ) ? n : 1;
5861
lapack_int lda_t = MAX(1,m);
5962
lapack_int ldu_t = MAX(1,nrows_u);
6063
lapack_int ldvt_t = MAX(1,nrows_vt);
@@ -72,7 +75,7 @@ lapack_int LAPACKE_cgesvd_work( int matrix_layout, char jobu, char jobvt,
7275
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
7376
return info;
7477
}
75-
if( ldvt < n ) {
78+
if( ldvt < ncols_vt ) {
7679
info = -12;
7780
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
7881
return info;

LAPACKE/src/lapacke_cheev_work.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*****************************************************************************
2929
* Contents: Native middle-level C interface to LAPACK function cheev
3030
* Author: Intel Corporation
31+
* Generated November 2015
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
@@ -77,7 +78,7 @@ lapack_int LAPACKE_cheev_work( int matrix_layout, char jobz, char uplo,
7778
info = info - 1;
7879
}
7980
/* Transpose output matrices */
80-
if ( jobz == 'V') {
81+
if ( jobz == 'V' || jobz == 'v' ) {
8182
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
8283
} else {
8384
LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );

LAPACKE/src/lapacke_cheevd_2stage_work.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*****************************************************************************
2929
* Contents: Native middle-level C interface to LAPACK function cheevd_2stage
3030
* Author: Intel Corporation
31+
* Generated December 2016
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
@@ -78,7 +79,7 @@ lapack_int LAPACKE_cheevd_2stage_work( int matrix_layout, char jobz, char uplo,
7879
info = info - 1;
7980
}
8081
/* Transpose output matrices */
81-
if ( jobz == 'V') {
82+
if ( jobz == 'V' || jobz == 'v' ) {
8283
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
8384
} else {
8485
LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );

LAPACKE/src/lapacke_cheevd_work.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*****************************************************************************
2929
* Contents: Native middle-level C interface to LAPACK function cheevd
3030
* Author: Intel Corporation
31+
* Generated November 2015
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
@@ -78,7 +79,7 @@ lapack_int LAPACKE_cheevd_work( int matrix_layout, char jobz, char uplo,
7879
info = info - 1;
7980
}
8081
/* Transpose output matrices */
81-
if ( jobz == 'V') {
82+
if ( jobz == 'V' || jobz == 'v' ) {
8283
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
8384
} else {
8485
LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );

LAPACKE/src/lapacke_chegst.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
*****************************************************************************
2929
* Contents: Native high-level C interface to LAPACK function chegst
3030
* Author: Intel Corporation
31+
* Generated November 2015
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
3435

3536
lapack_int LAPACKE_chegst( int matrix_layout, lapack_int itype, char uplo,
3637
lapack_int n, lapack_complex_float* a,
37-
lapack_int lda, lapack_complex_float* b,
38+
lapack_int lda, const lapack_complex_float* b,
3839
lapack_int ldb )
3940
{
4041
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
@@ -47,7 +48,7 @@ lapack_int LAPACKE_chegst( int matrix_layout, lapack_int itype, char uplo,
4748
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, a, lda ) ) {
4849
return -5;
4950
}
50-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, b, ldb ) ) {
51+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, b, ldb ) ) {
5152
return -7;
5253
}
5354
}

LAPACKE/src/lapacke_chegst_work.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
*****************************************************************************
2929
* Contents: Native middle-level C interface to LAPACK function chegst
3030
* Author: Intel Corporation
31+
* Generated November 2015
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
3435

3536
lapack_int LAPACKE_chegst_work( int matrix_layout, lapack_int itype, char uplo,
3637
lapack_int n, lapack_complex_float* a,
37-
lapack_int lda, lapack_complex_float* b,
38+
lapack_int lda, const lapack_complex_float* b,
3839
lapack_int ldb )
3940
{
4041
lapack_int info = 0;

LAPACKE/src/lapacke_chegv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*****************************************************************************
2929
* Contents: Native high-level C interface to LAPACK function chegv
3030
* Author: Intel Corporation
31+
* Generated November 2015
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
@@ -49,10 +50,10 @@ lapack_int LAPACKE_chegv( int matrix_layout, lapack_int itype, char jobz,
4950
#ifndef LAPACK_DISABLE_NAN_CHECK
5051
if( LAPACKE_get_nancheck() ) {
5152
/* Optionally check input matrices for NaNs */
52-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
53+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, a, lda ) ) {
5354
return -6;
5455
}
55-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, b, ldb ) ) {
56+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, b, ldb ) ) {
5657
return -8;
5758
}
5859
}

LAPACKE/src/lapacke_chegv_2stage.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*****************************************************************************
2929
* Contents: Native high-level C interface to LAPACK function chegv_2stage
3030
* Author: Intel Corporation
31+
* Generated December 2016
3132
*****************************************************************************/
3233

3334
#include "lapacke_utils.h"
@@ -49,10 +50,10 @@ lapack_int LAPACKE_chegv_2stage( int matrix_layout, lapack_int itype, char jobz,
4950
#ifndef LAPACK_DISABLE_NAN_CHECK
5051
if( LAPACKE_get_nancheck() ) {
5152
/* Optionally check input matrices for NaNs */
52-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
53+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, a, lda ) ) {
5354
return -6;
5455
}
55-
if( LAPACKE_cge_nancheck( matrix_layout, n, n, b, ldb ) ) {
56+
if( LAPACKE_che_nancheck( matrix_layout, uplo, n, b, ldb ) ) {
5657
return -8;
5758
}
5859
}

0 commit comments

Comments
 (0)