Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Y misscale in GEMV for some cases #787

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 10 additions & 6 deletions BLAS/SRC/cgemv.f
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ SUBROUTINE CGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
CALL XERBLA('CGEMV ',INFO)
RETURN
END IF
*
* Quick return if possible.
*
IF ((M.EQ.0) .OR. (N.EQ.0) .OR.
+ ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN
*
NOCONJ = LSAME(TRANS,'T')
*
Expand All @@ -243,6 +238,11 @@ SUBROUTINE CGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
KY = 1 - (LENY-1)*INCY
END IF
*
* Return, if Y does not change
*
IF ((LENY.EQ.0) .OR. ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE)))
+ RETURN
*
* Start the operations. In this version the elements of A are
* accessed sequentially with one pass through A.
*
Expand Down Expand Up @@ -274,7 +274,11 @@ SUBROUTINE CGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
END IF
END IF
END IF
IF (ALPHA.EQ.ZERO) RETURN
*
* Return, if Y does not change after scale
*
IF ((ALPHA.EQ.ZERO) .OR. (LENX.EQ.0)) RETURN
*
IF (LSAME(TRANS,'N')) THEN
*
* Form y := alpha*A*x + y.
Expand Down
16 changes: 10 additions & 6 deletions BLAS/SRC/dgemv.f
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,6 @@ SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
RETURN
END IF
*
* Quick return if possible.
*
IF ((M.EQ.0) .OR. (N.EQ.0) .OR.
+ ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN
*
* Set LENX and LENY, the lengths of the vectors x and y, and set
* up the start points in X and Y.
*
Expand All @@ -236,6 +231,11 @@ SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
KY = 1 - (LENY-1)*INCY
END IF
*
* Return, if Y does not change
*
IF ((LENY.EQ.0) .OR. ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE)))
+ RETURN
*
* Start the operations. In this version the elements of A are
* accessed sequentially with one pass through A.
*
Expand Down Expand Up @@ -267,7 +267,11 @@ SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
END IF
END IF
END IF
IF (ALPHA.EQ.ZERO) RETURN
*
* Return, if Y does not change after scale
*
IF ((ALPHA.EQ.ZERO) .OR. (LENX.EQ.0)) RETURN
*
IF (LSAME(TRANS,'N')) THEN
*
* Form y := alpha*A*x + y.
Expand Down
16 changes: 10 additions & 6 deletions BLAS/SRC/sgemv.f
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,6 @@ SUBROUTINE SGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
RETURN
END IF
*
* Quick return if possible.
*
IF ((M.EQ.0) .OR. (N.EQ.0) .OR.
+ ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN
*
* Set LENX and LENY, the lengths of the vectors x and y, and set
* up the start points in X and Y.
*
Expand All @@ -236,6 +231,11 @@ SUBROUTINE SGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
KY = 1 - (LENY-1)*INCY
END IF
*
* Return, if Y does not change
*
IF ((LENY.EQ.0) .OR. ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE)))
+ RETURN
*
* Start the operations. In this version the elements of A are
* accessed sequentially with one pass through A.
*
Expand Down Expand Up @@ -267,7 +267,11 @@ SUBROUTINE SGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
END IF
END IF
END IF
IF (ALPHA.EQ.ZERO) RETURN
*
* Return, if Y does not change after scale
*
IF ((ALPHA.EQ.ZERO) .OR. (LENX.EQ.0)) RETURN
*
IF (LSAME(TRANS,'N')) THEN
*
* Form y := alpha*A*x + y.
Expand Down
16 changes: 10 additions & 6 deletions BLAS/SRC/zgemv.f
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ SUBROUTINE ZGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
CALL XERBLA('ZGEMV ',INFO)
RETURN
END IF
*
* Quick return if possible.
*
IF ((M.EQ.0) .OR. (N.EQ.0) .OR.
+ ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN
*
NOCONJ = LSAME(TRANS,'T')
*
Expand All @@ -243,6 +238,11 @@ SUBROUTINE ZGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
KY = 1 - (LENY-1)*INCY
END IF
*
* Return, if Y does not change
*
IF ((LENY.EQ.0) .OR. ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE)))
+ RETURN
*
* Start the operations. In this version the elements of A are
* accessed sequentially with one pass through A.
*
Expand Down Expand Up @@ -274,7 +274,11 @@ SUBROUTINE ZGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
END IF
END IF
END IF
IF (ALPHA.EQ.ZERO) RETURN
*
* Return, if Y does not change after scale
*
IF ((ALPHA.EQ.ZERO) .OR. (LENX.EQ.0)) RETURN
*
IF (LSAME(TRANS,'N')) THEN
*
* Form y := alpha*A*x + y.
Expand Down