This repository has been archived by the owner on Nov 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lapack/cgo: apply LAPACK_dlantr fix patch and test
- Loading branch information
Showing
3 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
.travis/linux/OpenBLAS/0001-Fix-LAPACKE_dlantr-transpose-for-row-major-matrices.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From 7af11f77e3a08d529c45b43cb9121ca331342313 Mon Sep 17 00:00:00 2001 | ||
From: kortschak <dan.kortschak@adelaide.edu.au> | ||
Date: Mon, 7 Sep 2015 15:39:22 +0930 | ||
Subject: [PATCH] Fix LAPACKE_dlantr transpose for row major matrices | ||
|
||
--- | ||
lapack-netlib/lapacke/src/lapacke_dlantr.c | 2 +- | ||
lapack-netlib/lapacke/src/lapacke_dlantr_work.c | 6 +++--- | ||
2 files changed, 4 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/lapack-netlib/lapacke/src/lapacke_dlantr.c b/lapack-netlib/lapacke/src/lapacke_dlantr.c | ||
index 522122c..2cde1eb 100644 | ||
--- a/lapack-netlib/lapacke/src/lapacke_dlantr.c | ||
+++ b/lapack-netlib/lapacke/src/lapacke_dlantr.c | ||
@@ -53,7 +53,7 @@ double LAPACKE_dlantr( int matrix_order, char norm, char uplo, char diag, | ||
/* Allocate memory for working array(s) */ | ||
if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) || | ||
LAPACKE_lsame( norm, '0' ) ) { | ||
- work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) ); | ||
+ work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,MAX(m,n)) ); | ||
if( work == NULL ) { | ||
info = LAPACK_WORK_MEMORY_ERROR; | ||
goto exit_level_0; | ||
diff --git a/lapack-netlib/lapacke/src/lapacke_dlantr_work.c b/lapack-netlib/lapacke/src/lapacke_dlantr_work.c | ||
index 0a937bd..44d638f 100644 | ||
--- a/lapack-netlib/lapacke/src/lapacke_dlantr_work.c | ||
+++ b/lapack-netlib/lapacke/src/lapacke_dlantr_work.c | ||
@@ -46,7 +46,7 @@ double LAPACKE_dlantr_work( int matrix_order, char norm, char uplo, | ||
info = info - 1; | ||
} | ||
} else if( matrix_order == LAPACK_ROW_MAJOR ) { | ||
- lapack_int lda_t = MAX(1,n); | ||
+ lapack_int lda_t = MAX(1,m); | ||
double* a_t = NULL; | ||
/* Check leading dimension(s) */ | ||
if( lda < n ) { | ||
@@ -55,13 +55,13 @@ double LAPACKE_dlantr_work( int matrix_order, char norm, char uplo, | ||
return info; | ||
} | ||
/* Allocate memory for temporary array(s) */ | ||
- a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) ); | ||
+ a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,MAX(m,n)) ); | ||
if( a_t == NULL ) { | ||
info = LAPACK_TRANSPOSE_MEMORY_ERROR; | ||
goto exit_level_0; | ||
} | ||
/* Transpose input matrices */ | ||
- LAPACKE_dtr_trans( matrix_order, uplo, diag, n, a, lda, a_t, lda_t ); | ||
+ LAPACKE_dtr_trans( matrix_order, uplo, diag, MAX(m,n), a, lda, a_t, lda_t ); | ||
/* Call LAPACK function and adjust info */ | ||
res = LAPACK_dlantr( &norm, &uplo, &diag, &m, &n, a_t, &lda_t, work ); | ||
info = 0; /* LAPACK call is ok! */ | ||
-- | ||
1.7.9.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters