Update scaling routines to return immediately when scaling with one#674
Merged
langou merged 1 commit intoReference-LAPACK:masterfrom May 21, 2022
Merged
Update scaling routines to return immediately when scaling with one#674langou merged 1 commit intoReference-LAPACK:masterfrom
langou merged 1 commit intoReference-LAPACK:masterfrom
Conversation
* SCAL: Quick return if scaling factor is one * LASCL: If cto == cfrom and neither input is NaN or Inf, skip scaling
langou
reviewed
May 21, 2022
| * | ||
| DO I = 1,N | ||
| ZX(I) = DCMPLX(DA,0.0d0)*ZX(I) | ||
| ZX(I) = DCMPLX(DA*DBLE(ZX(I)),DA*DIMAG(ZX(I))) |
Contributor
There was a problem hiding this comment.
Nice. Thanks. Much better like this indeed. The previous line of code was weird.
langou
approved these changes
May 21, 2022
Contributor
langou
left a comment
There was a problem hiding this comment.
Thanks for the PR. Looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a proposal to add a check for alpha being equal to one to the early return criterion of the scaling routines.
It appears prudent to add an early exit to the BLAS and the LAPACK scaling routines and not rely on the caller to precede every invocation of a scaling routine with a check for one. Other BLAS routines such as HER or AXPY have a quick return based on the value of alpha already.