Skip to content

Commit d371e22

Browse files
committed
Fix the wrong implementation of the new tests for xblat1.f. (Fixes: #963)
Since this is a regression after upgrading from v3.11.0 to v3.12.0, we can narrow down the range of the bug into the newly added SB1NRM2 subroutine. According to the buildlog and the documentation in the code, the VALUES(9), calculated as SXVALS(XX,2) should be infty. But the current code is returning a zero (or randomly) initialized variable YY, which does not make sense. In fact, if you go back to the reference implementation, namely the supplementary material of this paper https://dl.acm.org/doi/abs/10.1145/3061665 You can find a similar implementation of the SXVALS function in the `la_xxvals.F90` file. This patch corrests the test following the reference code.
1 parent db501d9 commit d371e22

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

BLAS/TESTING/cblat1.f

+6-2
Original file line numberDiff line numberDiff line change
@@ -994,13 +994,17 @@ REAL FUNCTION SXVALS(XX,K)
994994
* .. Scalar Arguments ..
995995
REAL XX
996996
INTEGER K
997+
* .. Parameters ..
998+
REAL ZERO
999+
PARAMETER (ZERO=0.0E+0)
9971000
* .. Local Scalars ..
998-
REAL X, Y, YY, Z
1001+
REAL X, Y, Z
9991002
* .. Intrinsic Functions ..
10001003
INTRINSIC HUGE
10011004
* .. Executable Statements ..
1005+
X = ZERO
10021006
Y = HUGE(XX)
1003-
Z = YY
1007+
Z = Y*Y
10041008
IF (K.EQ.1) THEN
10051009
X = -Z
10061010
ELSE IF (K.EQ.2) THEN

BLAS/TESTING/dblat1.f

+6-2
Original file line numberDiff line numberDiff line change
@@ -1326,13 +1326,17 @@ DOUBLE PRECISION FUNCTION DXVALS(XX,K)
13261326
* .. Scalar Arguments ..
13271327
DOUBLE PRECISION XX
13281328
INTEGER K
1329+
* .. Parameters ..
1330+
DOUBLE PRECISION ZERO
1331+
PARAMETER (ZERO=0.0D+0)
13291332
* .. Local Scalars ..
1330-
DOUBLE PRECISION X, Y, YY, Z
1333+
DOUBLE PRECISION X, Y, Z
13311334
* .. Intrinsic Functions ..
13321335
INTRINSIC HUGE
13331336
* .. Executable Statements ..
1337+
X = ZERO
13341338
Y = HUGE(XX)
1335-
Z = YY
1339+
Z = Y*Y
13361340
IF (K.EQ.1) THEN
13371341
X = -Z
13381342
ELSE IF (K.EQ.2) THEN

BLAS/TESTING/sblat1.f

+6-2
Original file line numberDiff line numberDiff line change
@@ -1278,13 +1278,17 @@ REAL FUNCTION SXVALS(XX,K)
12781278
* .. Scalar Arguments ..
12791279
REAL XX
12801280
INTEGER K
1281+
* .. Parameters ..
1282+
REAL ZERO
1283+
PARAMETER (ZERO=0.0E+0)
12811284
* .. Local Scalars ..
1282-
REAL X, Y, YY, Z
1285+
REAL X, Y, Z
12831286
* .. Intrinsic Functions ..
12841287
INTRINSIC HUGE
12851288
* .. Executable Statements ..
1289+
X = ZERO
12861290
Y = HUGE(XX)
1287-
Z = YY
1291+
Z = Y*Y
12881292
IF (K.EQ.1) THEN
12891293
X = -Z
12901294
ELSE IF (K.EQ.2) THEN

BLAS/TESTING/zblat1.f

+6-2
Original file line numberDiff line numberDiff line change
@@ -994,13 +994,17 @@ DOUBLE PRECISION FUNCTION DXVALS(XX,K)
994994
* .. Scalar Arguments ..
995995
DOUBLE PRECISION XX
996996
INTEGER K
997+
* .. Parameters ..
998+
DOUBLE PRECISION ZERO
999+
PARAMETER (ZERO=0.0D+0)
9971000
* .. Local Scalars ..
998-
DOUBLE PRECISION X, Y, YY, Z
1001+
DOUBLE PRECISION X, Y, Z
9991002
* .. Intrinsic Functions ..
10001003
INTRINSIC HUGE
10011004
* .. Executable Statements ..
1005+
X = ZERO
10021006
Y = HUGE(XX)
1003-
Z = YY
1007+
Z = Y*Y
10041008
IF (K.EQ.1) THEN
10051009
X = -Z
10061010
ELSE IF (K.EQ.2) THEN

0 commit comments

Comments
 (0)