Skip to content

Commit 20b45b9

Browse files
authored
Merge pull request #741 from ACSimon33/lapacke_xtrsyl3_iwork_query
Added missing iwork query.
2 parents 755c71b + 48377cd commit 20b45b9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

LAPACKE/src/lapacke_dtrsyl3.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ lapack_int LAPACKE_dtrsyl3( int matrix_layout, char trana, char tranb,
1111
double* swork = NULL;
1212
lapack_int ldswork = -1;
1313
lapack_int swork_size = -1;
14+
lapack_int iwork_query;
1415
lapack_int* iwork = NULL;
1516
lapack_int liwork = -1;
1617
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
@@ -33,7 +34,7 @@ lapack_int LAPACKE_dtrsyl3( int matrix_layout, char trana, char tranb,
3334
#endif
3435
/* Query optimal working array sizes */
3536
info = LAPACKE_dtrsyl3_work( matrix_layout, trana, tranb, isgn, m, n, a, lda,
36-
b, ldb, c, ldc, scale, iwork, liwork,
37+
b, ldb, c, ldc, scale, &iwork_query, liwork,
3738
swork_query, ldswork );
3839
if( info != 0 ) {
3940
goto exit_level_0;
@@ -45,8 +46,9 @@ lapack_int LAPACKE_dtrsyl3( int matrix_layout, char trana, char tranb,
4546
info = LAPACK_WORK_MEMORY_ERROR;
4647
goto exit_level_0;
4748
}
49+
liwork = iwork_query;
4850
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
49-
if (iwork == NULL ) {
51+
if ( iwork == NULL ) {
5052
info = LAPACK_WORK_MEMORY_ERROR;
5153
goto exit_level_1;
5254
}

LAPACKE/src/lapacke_strsyl3.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ lapack_int LAPACKE_strsyl3( int matrix_layout, char trana, char tranb,
1111
float* swork = NULL;
1212
lapack_int ldswork = -1;
1313
lapack_int swork_size = -1;
14+
lapack_int iwork_query;
1415
lapack_int* iwork = NULL;
1516
lapack_int liwork = -1;
1617
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
@@ -33,7 +34,7 @@ lapack_int LAPACKE_strsyl3( int matrix_layout, char trana, char tranb,
3334
#endif
3435
/* Query optimal working array sizes */
3536
info = LAPACKE_strsyl3_work( matrix_layout, trana, tranb, isgn, m, n, a, lda,
36-
b, ldb, c, ldc, scale, iwork, liwork,
37+
b, ldb, c, ldc, scale, &iwork_query, liwork,
3738
swork_query, ldswork );
3839
if( info != 0 ) {
3940
goto exit_level_0;
@@ -45,8 +46,9 @@ lapack_int LAPACKE_strsyl3( int matrix_layout, char trana, char tranb,
4546
info = LAPACK_WORK_MEMORY_ERROR;
4647
goto exit_level_0;
4748
}
49+
liwork = iwork_query;
4850
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
49-
if (iwork == NULL ) {
51+
if ( iwork == NULL ) {
5052
info = LAPACK_WORK_MEMORY_ERROR;
5153
goto exit_level_1;
5254
}

0 commit comments

Comments
 (0)