diff options
author | Martin Kroeker <martin@ruby.chemie.uni-freiburg.de> | 2017-05-04 19:59:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-04 19:59:02 +0200 |
commit | 4beffaaa4b3d41883f9984152b58ae14d7b76d5d (patch) | |
tree | 99d6e70a7f303635d2e0fd092b18bdf4ccf2288d | |
parent | fb28e4adc93f9645360d24a35f3cccd1dfc35d86 (diff) | |
download | openblas-4beffaaa4b3d41883f9984152b58ae14d7b76d5d.tar.gz openblas-4beffaaa4b3d41883f9984152b58ae14d7b76d5d.tar.bz2 openblas-4beffaaa4b3d41883f9984152b58ae14d7b76d5d.zip |
Fix workspace computation for side=L
From netlib PR#144
-rw-r--r-- | lapack-netlib/LAPACKE/src/lapacke_stpmqrt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lapack-netlib/LAPACKE/src/lapacke_stpmqrt.c b/lapack-netlib/LAPACKE/src/lapacke_stpmqrt.c index 29df845a1..f7d65aca8 100644 --- a/lapack-netlib/LAPACKE/src/lapacke_stpmqrt.c +++ b/lapack-netlib/LAPACKE/src/lapacke_stpmqrt.c @@ -41,6 +41,7 @@ lapack_int LAPACKE_stpmqrt( int matrix_layout, char side, char trans, { lapack_int ncols_a, nrows_a; lapack_int nrows_v; + lapack_int lwork; lapack_int info = 0; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { @@ -69,7 +70,9 @@ lapack_int LAPACKE_stpmqrt( int matrix_layout, char side, char trans, } #endif /* Allocate memory for working array(s) */ - work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) * MAX(1,nb) ); + lwork = LAPACKE_lsame( side, 'L' ) ? MAX(1,nb) * MAX(1,n) : + ( LAPACKE_lsame( side, 'R' ) ? MAX(1,m) * MAX(1,nb) : 0 ); + work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; |