Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove SCEIL, replace calls with intrinsic CEILING
sceil.f is only referenced in SRC/VARIANTS/qr/LL/.
Replace all occurrences of calls to sceil with
the Fortran intrinsics CEILING, which is already
used by a bunch of other routines.
  • Loading branch information
angsch committed Jun 2, 2023
commit 65df15e8f5322353d01ba11158dd25d2ce497dcb
2 changes: 1 addition & 1 deletion SRC/VARIANTS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LULL = lu/LL/cgetrf.o lu/LL/dgetrf.o lu/LL/sgetrf.o lu/LL/zgetrf.o

LUREC = lu/REC/cgetrf.o lu/REC/dgetrf.o lu/REC/sgetrf.o lu/REC/zgetrf.o

QRLL = qr/LL/cgeqrf.o qr/LL/dgeqrf.o qr/LL/sgeqrf.o qr/LL/zgeqrf.o qr/LL/sceil.o
QRLL = qr/LL/cgeqrf.o qr/LL/dgeqrf.o qr/LL/sgeqrf.o qr/LL/zgeqrf.o


.PHONY: all
Expand Down
11 changes: 5 additions & 6 deletions SRC/VARIANTS/qr/LL/cgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ SUBROUTINE CGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
EXTERNAL CGEQR2, CLARFB, CLARFT, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
INTRINSIC CEILING, MAX, MIN, REAL
* ..
* .. External Functions ..
INTEGER ILAENV
REAL SCEIL
EXTERNAL ILAENV, SCEIL
EXTERNAL ILAENV
* ..
* .. Executable Statements ..

Expand Down Expand Up @@ -205,13 +204,13 @@ SUBROUTINE CGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
*
* So here 4 x 4 is the last T stored in the workspace
*
NT = K-SCEIL(REAL(K-NX)/REAL(NB))*NB
NT = K-CEILING(REAL(K-NX)/REAL(NB))*NB

*
* optimal workspace = space for dlarfb + space for normal T's + space for the last T
*
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))
LLWORK = CEILING(REAL(LLWORK)/REAL(NB))

IF( K.EQ.0 ) THEN

Expand All @@ -230,7 +229,7 @@ SUBROUTINE CGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )

ELSE

LBWORK = SCEIL(REAL(K)/REAL(NB))*NB
LBWORK = CEILING(REAL(K)/REAL(NB))*NB
LWKOPT = (LBWORK+LLWORK-NB)*NB
WORK( 1 ) = LWKOPT

Expand Down
11 changes: 5 additions & 6 deletions SRC/VARIANTS/qr/LL/dgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ SUBROUTINE DGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
EXTERNAL DGEQR2, DLARFB, DLARFT, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
INTRINSIC CEILING, MAX, MIN, REAL
* ..
* .. External Functions ..
INTEGER ILAENV
REAL SCEIL
EXTERNAL ILAENV, SCEIL
EXTERNAL ILAENV
* ..
* .. Executable Statements ..

Expand Down Expand Up @@ -205,13 +204,13 @@ SUBROUTINE DGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
*
* So here 4 x 4 is the last T stored in the workspace
*
NT = K-SCEIL(REAL(K-NX)/REAL(NB))*NB
NT = K-CEILING(REAL(K-NX)/REAL(NB))*NB

*
* optimal workspace = space for dlarfb + space for normal T's + space for the last T
*
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))
LLWORK = CEILING(REAL(LLWORK)/REAL(NB))

IF( K.EQ.0 ) THEN

Expand All @@ -230,7 +229,7 @@ SUBROUTINE DGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )

ELSE

LBWORK = SCEIL(REAL(K)/REAL(NB))*NB
LBWORK = CEILING(REAL(K)/REAL(NB))*NB
LWKOPT = (LBWORK+LLWORK-NB)*NB
WORK( 1 ) = LWKOPT

Expand Down
86 changes: 0 additions & 86 deletions SRC/VARIANTS/qr/LL/sceil.f

This file was deleted.

11 changes: 5 additions & 6 deletions SRC/VARIANTS/qr/LL/sgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ SUBROUTINE SGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
EXTERNAL SGEQR2, SLARFB, SLARFT, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
INTRINSIC CEILING, MAX, MIN, REAL
* ..
* .. External Functions ..
INTEGER ILAENV
REAL SCEIL
EXTERNAL ILAENV, SCEIL
EXTERNAL ILAENV
* ..
* .. Executable Statements ..

Expand Down Expand Up @@ -205,13 +204,13 @@ SUBROUTINE SGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
*
* So here 4 x 4 is the last T stored in the workspace
*
NT = K-SCEIL(REAL(K-NX)/REAL(NB))*NB
NT = K-CEILING(REAL(K-NX)/REAL(NB))*NB

*
* optimal workspace = space for dlarfb + space for normal T's + space for the last T
*
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))
LLWORK = CEILING(REAL(LLWORK)/REAL(NB))

IF( K.EQ.0 ) THEN

Expand All @@ -230,7 +229,7 @@ SUBROUTINE SGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )

ELSE

LBWORK = SCEIL(REAL(K)/REAL(NB))*NB
LBWORK = CEILING(REAL(K)/REAL(NB))*NB
LWKOPT = (LBWORK+LLWORK-NB)*NB
WORK( 1 ) = LWKOPT

Expand Down
11 changes: 5 additions & 6 deletions SRC/VARIANTS/qr/LL/zgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ SUBROUTINE ZGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
EXTERNAL ZGEQR2, ZLARFB, ZLARFT, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
INTRINSIC CEILING, MAX, MIN, REAL
* ..
* .. External Functions ..
INTEGER ILAENV
REAL SCEIL
EXTERNAL ILAENV, SCEIL
EXTERNAL ILAENV
* ..
* .. Executable Statements ..

Expand Down Expand Up @@ -205,13 +204,13 @@ SUBROUTINE ZGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
*
* So here 4 x 4 is the last T stored in the workspace
*
NT = K-SCEIL(REAL(K-NX)/REAL(NB))*NB
NT = K-CEILING(REAL(K-NX)/REAL(NB))*NB

*
* optimal workspace = space for dlarfb + space for normal T's + space for the last T
*
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))
LLWORK = CEILING(REAL(LLWORK)/REAL(NB))

IF( K.EQ.0 ) THEN

Expand All @@ -230,7 +229,7 @@ SUBROUTINE ZGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )

ELSE

LBWORK = SCEIL(REAL(K)/REAL(NB))*NB
LBWORK = CEILING(REAL(K)/REAL(NB))*NB
LWKOPT = (LBWORK+LLWORK-NB)*NB
WORK( 1 ) = LWKOPT

Expand Down