From 958f0de65e234e03b274871b018407807a786326 Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Sat, 5 Dec 2015 00:45:29 +0800 Subject: [PATCH 1/3] Refs #708. Modified config template for MSVC. --- openblas_config_template.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openblas_config_template.h b/openblas_config_template.h index b2a68c20e..fd6171492 100644 --- a/openblas_config_template.h +++ b/openblas_config_template.h @@ -58,9 +58,8 @@ typedef int blasint; /* C99 supports complex floating numbers natively, which GCC also offers as an extension since version 3.0. If neither are available, use a compatible structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ -#if (defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ - (__GNUC__ >= 3 && !defined(__cplusplus)) || \ - (_MSC_VER >= 1800 && !defined(__cplusplus))) // Visual Studio 2013 supports complex +#if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ + (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) #define OPENBLAS_COMPLEX_C99 #ifndef __cplusplus #include From 2f65aad626d38eb2b60982760e8e0a68cef9a9af Mon Sep 17 00:00:00 2001 From: Brendan Tracey Date: Tue, 8 Dec 2015 22:34:21 -0700 Subject: [PATCH 2/3] Fix Dormlq to perform the correct size operations with RowMajor Fixes issue #615. --- lapack-netlib/LAPACKE/src/lapacke_dormlq_work.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lapack-netlib/LAPACKE/src/lapacke_dormlq_work.c b/lapack-netlib/LAPACKE/src/lapacke_dormlq_work.c index 8f3d32c07..2a59cd56a 100644 --- a/lapack-netlib/LAPACKE/src/lapacke_dormlq_work.c +++ b/lapack-netlib/LAPACKE/src/lapacke_dormlq_work.c @@ -72,7 +72,11 @@ lapack_int LAPACKE_dormlq_work( int matrix_layout, char side, char trans, return (info < 0) ? (info - 1) : info; } /* Allocate memory for temporary array(s) */ - a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,m) ); + if( LAPACKE_lsame( side, 'l' ) ) { + a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,m) ); + } else { + a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) ); + } if( a_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_0; @@ -83,7 +87,12 @@ lapack_int LAPACKE_dormlq_work( int matrix_layout, char side, char trans, goto exit_level_1; } /* Transpose input matrices */ - LAPACKE_dge_trans( matrix_layout, k, m, a, lda, a_t, lda_t ); + if( LAPACKE_lsame( side, 'l' ) ){ + LAPACKE_dge_trans( matrix_layout, k, m, a, lda, a_t, lda_t ); + } else { + LAPACKE_dge_trans( matrix_layout, k, n, a, lda, a_t, lda_t ); + } + LAPACKE_dge_trans( matrix_layout, m, n, c, ldc, c_t, ldc_t ); /* Call LAPACK function and adjust info */ LAPACK_dormlq( &side, &trans, &m, &n, &k, a_t, &lda_t, tau, c_t, &ldc_t, From b3f100dc25f979e2290aa409e5cba05871638515 Mon Sep 17 00:00:00 2001 From: Brendan Tracey Date: Wed, 9 Dec 2015 00:50:22 -0700 Subject: [PATCH 3/3] Fix Dormbr to perform the correct size operations with RowMajor Fixes issue #712 --- lapack-netlib/LAPACKE/src/lapacke_dormbr_work.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lapack-netlib/LAPACKE/src/lapacke_dormbr_work.c b/lapack-netlib/LAPACKE/src/lapacke_dormbr_work.c index 3ac76fb05..9db92ce98 100644 --- a/lapack-netlib/LAPACKE/src/lapacke_dormbr_work.c +++ b/lapack-netlib/LAPACKE/src/lapacke_dormbr_work.c @@ -73,8 +73,12 @@ lapack_int LAPACKE_dormbr_work( int matrix_layout, char vect, char side, return (info < 0) ? (info - 1) : info; } /* Allocate memory for temporary array(s) */ - a_t = (double*) - LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,MIN(nq,k)) ); + if( LAPACKE_lsame( vect, 'q' ) ) { + a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * k ); + } else { + a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * nq ); + } + if( a_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_0; @@ -85,7 +89,11 @@ lapack_int LAPACKE_dormbr_work( int matrix_layout, char vect, char side, goto exit_level_1; } /* Transpose input matrices */ - LAPACKE_dge_trans( matrix_layout, r, MIN(nq,k), a, lda, a_t, lda_t ); + if( LAPACKE_lsame( vect, 'q' ) ) { + LAPACKE_dge_trans( matrix_layout, nq, k, a, lda, a_t, lda_t ); + } else { + LAPACKE_dge_trans( matrix_layout, k, nq, a, lda, a_t, lda_t ); + } LAPACKE_dge_trans( matrix_layout, m, n, c, ldc, c_t, ldc_t ); /* Call LAPACK function and adjust info */ LAPACK_dormbr( &vect, &side, &trans, &m, &n, &k, a_t, &lda_t, tau, c_t,