From: julie Date: Tue, 23 Feb 2016 05:40:02 +0000 (+0000) Subject: APPLYING INTEL PATCHES sent to Julie on Feb 19th 2016 by Dima from INTEL (dmitry... X-Git-Tag: accepted/tizen/5.0/unified/20181102.024111~209 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25ac4072451e9596e94179b0907f7e8558e3d679;p=platform%2Fupstream%2Flapack.git APPLYING INTEL PATCHES sent to Julie on Feb 19th 2016 by Dima from INTEL (dmitry.g.baksheev@intel.com) [PATCH 28/42] Fix lapacke_?gesvj - correct eval of nrows_v --- diff --git a/LAPACKE/src/lapacke_cgesvj.c b/LAPACKE/src/lapacke_cgesvj.c index 2f968af..c9851e7 100644 --- a/LAPACKE/src/lapacke_cgesvj.c +++ b/LAPACKE/src/lapacke_cgesvj.c @@ -52,8 +52,8 @@ lapack_int LAPACKE_cgesvj( int matrix_layout, char joba, char jobu, char jobv, } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ - nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) { return -7; } diff --git a/LAPACKE/src/lapacke_cgesvj_work.c b/LAPACKE/src/lapacke_cgesvj_work.c index d2f24d0..c2bcef1 100644 --- a/LAPACKE/src/lapacke_cgesvj_work.c +++ b/LAPACKE/src/lapacke_cgesvj_work.c @@ -50,8 +50,8 @@ lapack_int LAPACKE_cgesvj_work( int matrix_layout, char joba, char jobu, info = info - 1; } } else if( matrix_layout == LAPACK_ROW_MAJOR ) { - lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); lapack_int lda_t = MAX(1,m); lapack_int ldv_t = MAX(1,nrows_v); lapack_complex_float* a_t = NULL; diff --git a/LAPACKE/src/lapacke_dgesvj.c b/LAPACKE/src/lapacke_dgesvj.c index 1ffd432..8723c80 100644 --- a/LAPACKE/src/lapacke_dgesvj.c +++ b/LAPACKE/src/lapacke_dgesvj.c @@ -49,8 +49,8 @@ lapack_int LAPACKE_dgesvj( int matrix_layout, char joba, char jobu, char jobv, } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ - nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); if( LAPACKE_dge_nancheck( matrix_layout, m, n, a, lda ) ) { return -7; } diff --git a/LAPACKE/src/lapacke_dgesvj_work.c b/LAPACKE/src/lapacke_dgesvj_work.c index f2b1b9c..83f07b4 100644 --- a/LAPACKE/src/lapacke_dgesvj_work.c +++ b/LAPACKE/src/lapacke_dgesvj_work.c @@ -48,8 +48,8 @@ lapack_int LAPACKE_dgesvj_work( int matrix_layout, char joba, char jobu, info = info - 1; } } else if( matrix_layout == LAPACK_ROW_MAJOR ) { - lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); lapack_int lda_t = MAX(1,m); lapack_int ldv_t = MAX(1,nrows_v); double* a_t = NULL; diff --git a/LAPACKE/src/lapacke_sgesvj.c b/LAPACKE/src/lapacke_sgesvj.c index 25e4383..f776d83 100644 --- a/LAPACKE/src/lapacke_sgesvj.c +++ b/LAPACKE/src/lapacke_sgesvj.c @@ -49,8 +49,8 @@ lapack_int LAPACKE_sgesvj( int matrix_layout, char joba, char jobu, char jobv, } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ - nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0 ); if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -7; } diff --git a/LAPACKE/src/lapacke_sgesvj_work.c b/LAPACKE/src/lapacke_sgesvj_work.c index 74bdeea..ba89c11 100644 --- a/LAPACKE/src/lapacke_sgesvj_work.c +++ b/LAPACKE/src/lapacke_sgesvj_work.c @@ -48,8 +48,8 @@ lapack_int LAPACKE_sgesvj_work( int matrix_layout, char joba, char jobu, info = info - 1; } } else if( matrix_layout == LAPACK_ROW_MAJOR ) { - lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); lapack_int lda_t = MAX(1,m); lapack_int ldv_t = MAX(1,nrows_v); float* a_t = NULL; diff --git a/LAPACKE/src/lapacke_zgesvj.c b/LAPACKE/src/lapacke_zgesvj.c index dbd5c43..a7e91bf 100644 --- a/LAPACKE/src/lapacke_zgesvj.c +++ b/LAPACKE/src/lapacke_zgesvj.c @@ -52,8 +52,8 @@ lapack_int LAPACKE_zgesvj( int matrix_layout, char joba, char jobu, char jobv, } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ - nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); if( LAPACKE_zge_nancheck( matrix_layout, m, n, a, lda ) ) { return -7; } diff --git a/LAPACKE/src/lapacke_zgesvj_work.c b/LAPACKE/src/lapacke_zgesvj_work.c index e618bf9..5d139a0 100644 --- a/LAPACKE/src/lapacke_zgesvj_work.c +++ b/LAPACKE/src/lapacke_zgesvj_work.c @@ -50,8 +50,8 @@ lapack_int LAPACKE_zgesvj_work( int matrix_layout, char joba, char jobu, info = info - 1; } } else if( matrix_layout == LAPACK_ROW_MAJOR ) { - lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n : - ( LAPACKE_lsame( jobv, 'a' ) ? mv : 1); + lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : + ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0); lapack_int lda_t = MAX(1,m); lapack_int ldv_t = MAX(1,nrows_v); lapack_complex_double* a_t = NULL;