Skip to content

Fix Y misscale in GEMV for some cases#787

Closed
bE554357 wants to merge 1 commit intoReference-LAPACK:masterfrom
bE554357:fix-skip-scale-in-gemv
Closed

Fix Y misscale in GEMV for some cases#787
bE554357 wants to merge 1 commit intoReference-LAPACK:masterfrom
bE554357:fix-skip-scale-in-gemv

Conversation

@bE554357
Copy link
Copy Markdown

@bE554357 bE554357 commented Jan 22, 2023

Description

According to the description, $M$ or $N$ could be zero. It is expected that the vector $\mathbf{y}$ will be correctly scaled by scalar for such cases.

For example, let GEMV computes
$\mathbf{y} := 0 \cdot \mathbf{y} + \mathbf{A}\mathbf{x}$
and $\mathbf{x}$ is zero length vector. It is expected, that $\mathbf{y} = 0$ after GEMV, but it is not scaled due to statement in implementation:

- 	 IF ((M.EQ.0) .OR. (N.EQ.0) .OR.
-     +    ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN

This pull request is objected to fix the behavior in such cases.

@langou
Copy link
Copy Markdown
Contributor

langou commented Jan 23, 2023

Hi,

Note that the code follows the convention as written in the article

J. J. Dongarra, J. Du Croz, S. Hammarling, and R. J. Hanson. An extended set of FORTRAN Basic Linear Algebra Subprograms. ACM Trans. Math. Software, 14:1–32, 399, 1988.

I quote (page 5, section 3 - naming convention)

Note that it is permissible to call the routines with M or N = 0, in which case the routines exit immediately without referencing their vector or matrix arguments.

Cheers,
Julien.

@langou langou closed this Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants