Skip to content

Commit

Permalink
Apply ROUNDUP_LWORK (Reference-LAPACK PR 904)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-frbg authored Nov 12, 2023
1 parent c9378ba commit 71fbdd9
Show file tree
Hide file tree
Showing 57 changed files with 282 additions and 228 deletions.
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chetrd_he2hb.f
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetrd_he2hb
*
*> \par Further Details:
* =====================
Expand Down Expand Up @@ -283,7 +283,8 @@ SUBROUTINE CHETRD_HE2HB( UPLO, N, KD, A, LDA, AB, LDAB, TAU,
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV2STAGE
EXTERNAL LSAME, ILAENV2STAGE
REAL SROUNDUP_LWORK
EXTERNAL LSAME, ILAENV2STAGE, SROUNDUP_LWORK
* ..
* .. Executable Statements ..
*
Expand Down Expand Up @@ -313,7 +314,7 @@ SUBROUTINE CHETRD_HE2HB( UPLO, N, KD, A, LDA, AB, LDAB, TAU,
CALL XERBLA( 'CHETRD_HE2HB', -INFO )
RETURN
ELSE IF( LQUERY ) THEN
WORK( 1 ) = LWMIN
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
RETURN
END IF
*
Expand Down Expand Up @@ -506,7 +507,7 @@ SUBROUTINE CHETRD_HE2HB( UPLO, N, KD, A, LDA, AB, LDAB, TAU,

END IF
*
WORK( 1 ) = LWMIN
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
RETURN
*
* End of CHETRD_HE2HB
Expand Down
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chetrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetrf
*
*> \par Further Details:
* =====================
Expand Down Expand Up @@ -197,7 +197,8 @@ SUBROUTINE CHETRF( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV
EXTERNAL LSAME, ILAENV
REAL SROUNDUP_LWORK
EXTERNAL LSAME, ILAENV, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CHETF2, CLAHEF, XERBLA
Expand Down Expand Up @@ -228,7 +229,7 @@ SUBROUTINE CHETRF( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
*
NB = ILAENV( 1, 'CHETRF', UPLO, N, -1, -1, -1 )
LWKOPT = N*NB
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
END IF
*
IF( INFO.NE.0 ) THEN
Expand Down Expand Up @@ -346,7 +347,7 @@ SUBROUTINE CHETRF( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
END IF
*
40 CONTINUE
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
RETURN
*
* End of CHETRF
Expand Down
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chetrf_aa.f
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetrf_aa
*
* =====================================================================
SUBROUTINE CHETRF_AA( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
Expand Down Expand Up @@ -159,7 +159,8 @@ SUBROUTINE CHETRF_AA( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV
EXTERNAL LSAME, ILAENV
REAL SROUNDUP_LWORK
EXTERNAL LSAME, ILAENV, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CLAHEF_AA, CGEMM, CCOPY, CSWAP, CSCAL, XERBLA
Expand Down Expand Up @@ -190,7 +191,7 @@ SUBROUTINE CHETRF_AA( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
*
IF( INFO.EQ.0 ) THEN
LWKOPT = (NB+1)*N
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
END IF
*
IF( INFO.NE.0 ) THEN
Expand Down Expand Up @@ -459,7 +460,7 @@ SUBROUTINE CHETRF_AA( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
END IF
*
20 CONTINUE
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
RETURN
*
* End of CHETRF_AA
Expand Down
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chetrf_rk.f
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetrf_rk
*
*> \par Further Details:
* =====================
Expand Down Expand Up @@ -280,7 +280,8 @@ SUBROUTINE CHETRF_RK( UPLO, N, A, LDA, E, IPIV, WORK, LWORK,
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV
EXTERNAL LSAME, ILAENV
REAL SROUNDUP_LWORK
EXTERNAL LSAME, ILAENV, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CLAHEF_RK, CHETF2_RK, CSWAP, XERBLA
Expand Down Expand Up @@ -311,7 +312,7 @@ SUBROUTINE CHETRF_RK( UPLO, N, A, LDA, E, IPIV, WORK, LWORK,
*
NB = ILAENV( 1, 'CHETRF_RK', UPLO, N, -1, -1, -1 )
LWKOPT = N*NB
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
END IF
*
IF( INFO.NE.0 ) THEN
Expand Down Expand Up @@ -487,7 +488,7 @@ SUBROUTINE CHETRF_RK( UPLO, N, A, LDA, E, IPIV, WORK, LWORK,
*
END IF
*
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
RETURN
*
* End of CHETRF_RK
Expand Down
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chetrf_rook.f
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetrf_rook
*
*> \par Further Details:
* =====================
Expand Down Expand Up @@ -232,7 +232,8 @@ SUBROUTINE CHETRF_ROOK( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV
EXTERNAL LSAME, ILAENV
REAL SROUNDUP_LWORK
EXTERNAL LSAME, ILAENV, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CLAHEF_ROOK, CHETF2_ROOK, XERBLA
Expand Down Expand Up @@ -263,7 +264,7 @@ SUBROUTINE CHETRF_ROOK( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
*
NB = ILAENV( 1, 'CHETRF_ROOK', UPLO, N, -1, -1, -1 )
LWKOPT = MAX( 1, N*NB )
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
END IF
*
IF( INFO.NE.0 ) THEN
Expand Down Expand Up @@ -386,7 +387,7 @@ SUBROUTINE CHETRF_ROOK( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
END IF
*
40 CONTINUE
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
RETURN
*
* End of CHETRF_ROOK
Expand Down
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chetri_3.f
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetri_3
*
*> \par Contributors:
* ==================
Expand Down Expand Up @@ -190,7 +190,8 @@ SUBROUTINE CHETRI_3( UPLO, N, A, LDA, E, IPIV, WORK, LWORK,
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV
EXTERNAL LSAME, ILAENV
REAL SROUNDUP_LWORK
EXTERNAL LSAME, ILAENV, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CHETRI_3X, XERBLA
Expand Down Expand Up @@ -225,7 +226,7 @@ SUBROUTINE CHETRI_3( UPLO, N, A, LDA, E, IPIV, WORK, LWORK,
CALL XERBLA( 'CHETRI_3', -INFO )
RETURN
ELSE IF( LQUERY ) THEN
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
RETURN
END IF
*
Expand All @@ -236,7 +237,7 @@ SUBROUTINE CHETRI_3( UPLO, N, A, LDA, E, IPIV, WORK, LWORK,
*
CALL CHETRI_3X( UPLO, N, A, LDA, E, IPIV, WORK, NB, INFO )
*
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
*
RETURN
*
Expand Down
7 changes: 4 additions & 3 deletions lapack-netlib/SRC/chetrs_aa.f
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexHEcomputational
*> \ingroup hetrs_aa
*
* =====================================================================
SUBROUTINE CHETRS_AA( UPLO, N, NRHS, A, LDA, IPIV, B, LDB,
Expand Down Expand Up @@ -155,7 +155,8 @@ SUBROUTINE CHETRS_AA( UPLO, N, NRHS, A, LDA, IPIV, B, LDB,
* ..
* .. External Functions ..
LOGICAL LSAME
EXTERNAL LSAME
REAL SROUNDUP_LWORK
EXTERNAL LSAME,SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CLACPY, CLACGV, CGTSV, CSWAP, CTRSM, XERBLA
Expand Down Expand Up @@ -186,7 +187,7 @@ SUBROUTINE CHETRS_AA( UPLO, N, NRHS, A, LDA, IPIV, B, LDB,
RETURN
ELSE IF( LQUERY ) THEN
LWKOPT = (3*N-2)
WORK( 1 ) = LWKOPT
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
RETURN
END IF
*
Expand Down
10 changes: 5 additions & 5 deletions lapack-netlib/SRC/chpevd.f
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexOTHEReigen
*> \ingroup hpevd
*
* =====================================================================
SUBROUTINE CHPEVD( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
Expand Down Expand Up @@ -223,8 +223,8 @@ SUBROUTINE CHPEVD( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
* ..
* .. External Functions ..
LOGICAL LSAME
REAL CLANHP, SLAMCH
EXTERNAL LSAME, CLANHP, SLAMCH
REAL CLANHP, SLAMCH, SROUNDUP_LWORK
EXTERNAL LSAME, CLANHP, SLAMCH, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CHPTRD, CSSCAL, CSTEDC, CUPMTR, SSCAL, SSTERF,
Expand Down Expand Up @@ -268,7 +268,7 @@ SUBROUTINE CHPEVD( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
LIWMIN = 1
END IF
END IF
WORK( 1 ) = LWMIN
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
RWORK( 1 ) = LRWMIN
IWORK( 1 ) = LIWMIN
*
Expand Down Expand Up @@ -359,7 +359,7 @@ SUBROUTINE CHPEVD( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
CALL SSCAL( IMAX, ONE / SIGMA, W, 1 )
END IF
*
WORK( 1 ) = LWMIN
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
RWORK( 1 ) = LRWMIN
IWORK( 1 ) = LIWMIN
RETURN
Expand Down
9 changes: 5 additions & 4 deletions lapack-netlib/SRC/chpgvd.f
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexOTHEReigen
*> \ingroup hpgvd
*
*> \par Contributors:
* ==================
Expand Down Expand Up @@ -246,7 +246,8 @@ SUBROUTINE CHPGVD( ITYPE, JOBZ, UPLO, N, AP, BP, W, Z, LDZ, WORK,
* ..
* .. External Functions ..
LOGICAL LSAME
EXTERNAL LSAME
REAL SROUNDUP_LWORK
EXTERNAL LSAME, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CHPEVD, CHPGST, CPPTRF, CTPMV, CTPSV, XERBLA
Expand Down Expand Up @@ -292,7 +293,7 @@ SUBROUTINE CHPGVD( ITYPE, JOBZ, UPLO, N, AP, BP, W, Z, LDZ, WORK,
END IF
END IF
*
WORK( 1 ) = LWMIN
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
RWORK( 1 ) = LRWMIN
IWORK( 1 ) = LIWMIN
IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY ) THEN
Expand Down Expand Up @@ -374,7 +375,7 @@ SUBROUTINE CHPGVD( ITYPE, JOBZ, UPLO, N, AP, BP, W, Z, LDZ, WORK,
END IF
END IF
*
WORK( 1 ) = LWMIN
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
RWORK( 1 ) = LRWMIN
IWORK( 1 ) = LIWMIN
RETURN
Expand Down
5 changes: 3 additions & 2 deletions lapack-netlib/SRC/chseqr.f
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexOTHERcomputational
*> \ingroup hseqr
*
*> \par Contributors:
* ==================
Expand Down Expand Up @@ -343,7 +343,8 @@ SUBROUTINE CHSEQR( JOB, COMPZ, N, ILO, IHI, H, LDH, W, Z, LDZ,
* .. External Functions ..
INTEGER ILAENV
LOGICAL LSAME
EXTERNAL ILAENV, LSAME
REAL SROUNDUP_LWORK
EXTERNAL ILAENV, LSAME, SROUNDUP_LWORK
* ..
* .. External Subroutines ..
EXTERNAL CCOPY, CLACPY, CLAHQR, CLAQR0, CLASET, XERBLA
Expand Down
11 changes: 7 additions & 4 deletions lapack-netlib/SRC/clamswlq.f
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
*> SIAM J. Sci. Comput, vol. 34, no. 1, 2012
*> \endverbatim
*>
*> \ingroup lamswlq
*>
* =====================================================================
SUBROUTINE CLAMSWLQ( SIDE, TRANS, M, N, K, MB, NB, A, LDA, T,
$ LDT, C, LDC, WORK, LWORK, INFO )
Expand All @@ -215,7 +217,8 @@ SUBROUTINE CLAMSWLQ( SIDE, TRANS, M, N, K, MB, NB, A, LDA, T,
* ..
* .. External Functions ..
LOGICAL LSAME
EXTERNAL LSAME
REAL SROUNDUP_LWORK
EXTERNAL LSAME, SROUNDUP_LWORK
* .. External Subroutines ..
EXTERNAL CTPMLQT, CGEMLQT, XERBLA
* ..
Expand Down Expand Up @@ -259,10 +262,10 @@ SUBROUTINE CLAMSWLQ( SIDE, TRANS, M, N, K, MB, NB, A, LDA, T,
*
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'CLAMSWLQ', -INFO )
WORK(1) = LW
WORK(1) = SROUNDUP_LWORK(LW)
RETURN
ELSE IF (LQUERY) THEN
WORK(1) = LW
WORK(1) = SROUNDUP_LWORK(LW)
RETURN
END IF
*
Expand Down Expand Up @@ -401,7 +404,7 @@ SUBROUTINE CLAMSWLQ( SIDE, TRANS, M, N, K, MB, NB, A, LDA, T,
*
END IF
*
WORK(1) = LW
WORK(1) = SROUNDUP_LWORK(LW)
RETURN
*
* End of CLAMSWLQ
Expand Down
Loading

0 comments on commit 71fbdd9

Please sign in to comment.