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

Conversation

bE554357
Copy link

@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
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