BLAS: Restore compact ROTMG flag output when no rescaling occurs - #1344
Conversation
6dc1a78 normalized DFLAG 0/1 to -1 for every regular result, contradicting the documented compact DPARAM forms and failing the xblat1 ROTMG tests at points 1-2. The ELSE IF guard alone is enough to fix the Reference-LAPACK#244 clobber, so keep the normalization inside the loops. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks. Related, I wonder why we do not do what I suggested at: #1000 (comment). That is to replace these lines: Lines 115 to 119 in cf47d31 with DOUBLE PRECISION, PARAMETER :: GAM = 2.0D0**12
DOUBLE PRECISION, PARAMETER :: GAMSQ = 2.0D0**24
DOUBLE PRECISION, PARAMETER :: RGAMSQ = 2.0D0**(-24) |
|
No objections from my side, but should that be part of this PR? I'd create a separate PR that replaces the DATA statements with PARAMETERS. |
|
@ACSimon33 wrote: "No objections from my side, but should that be part of this PR? I'd create a separate PR that replaces the DATA statements with PARAMETERS." OKey doc. Let us do a separate PR. Good idea. I'll work on it when I can. Thanks! Note: there are two reasons for the future PR, (1) yes, replace DATA statements with PARAMETERS, and (2) enter accurate values for the variables GAMSQ and RGAMSQ. Right now, the variables GAMSQ and RGAMSQ are approximations of their exact values. Since we can store them exactly, we might as well store them exactly as opposed to use approximations. |
Description
Since 6dc1a78 (#1284, the fix for #244),
SROTMG/DROTMGnormalizeDFLAG0/1 to -1 for every regular result, not just rescaled ones. Thatcontradicts the documented compact
DPARAMforms (implied values "ARE NOTSTORED"), diverges from other implementations (OpenBLAS, MKL, Gonum), costs
xROTMits cheaper flag-0/1 paths, and failsxblat1's ROTMG points 1–2,whose expected results still encode the compact forms:
The commit message of 6dc1a78 describes a minimal fix — change the scaling
loops'
ELSEtoELSE IF (DFLAG.EQ.ONE)so the implied-elementinitialization can't clobber an already-scaled
DH12/DH21— but the codeinstead hoisted the normalization out of the loops and made it
unconditional. This PR implements what the message described: normalization
back inside both loops, with the guard.