Skip to content

Commit 7e3e006

Browse files
authored
Merge pull request #2666 from martin-frbg/blastest
Update BLAS tests to what netlib 3.9.0 uses
2 parents d906d14 + 18a1113 commit 7e3e006

File tree

10 files changed

+1036
-592
lines changed

10 files changed

+1036
-592
lines changed

test/cblat1.f

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,49 @@
1+
*> \brief \b CBLAT1
2+
*
3+
* =========== DOCUMENTATION ===========
4+
*
5+
* Online html documentation available at
6+
* http://www.netlib.org/lapack/explore-html/
7+
*
8+
* Definition:
9+
* ===========
10+
*
11+
* PROGRAM CBLAT1
12+
*
13+
*
14+
*> \par Purpose:
15+
* =============
16+
*>
17+
*> \verbatim
18+
*>
19+
*> Test program for the COMPLEX Level 1 BLAS.
20+
*> Based upon the original BLAS test routine together with:
21+
*>
22+
*> F06GAF Example Program Text
23+
*> \endverbatim
24+
*
25+
* Authors:
26+
* ========
27+
*
28+
*> \author Univ. of Tennessee
29+
*> \author Univ. of California Berkeley
30+
*> \author Univ. of Colorado Denver
31+
*> \author NAG Ltd.
32+
*
33+
*> \date April 2012
34+
*
35+
*> \ingroup complex_blas_testing
36+
*
37+
* =====================================================================
138
PROGRAM CBLAT1
2-
* Test program for the COMPLEX Level 1 BLAS.
3-
* Based upon the original BLAS test routine together with:
4-
* F06GAF Example Program Text
39+
*
40+
* -- Reference BLAS test routine (version 3.7.0) --
41+
* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
42+
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
43+
* April 2012
44+
*
45+
* =====================================================================
46+
*
547
* .. Parameters ..
648
INTEGER NOUT
749
PARAMETER (NOUT=6)
@@ -114,8 +156,8 @@ SUBROUTINE CHECK1(SFAC)
114156
+ (5.0E0,6.0E0), (5.0E0,6.0E0), (0.1E0,0.1E0),
115157
+ (-0.6E0,0.1E0), (0.1E0,-0.3E0), (7.0E0,8.0E0),
116158
+ (7.0E0,8.0E0), (7.0E0,8.0E0), (7.0E0,8.0E0),
117-
+ (7.0E0,8.0E0), (0.3E0,0.1E0), (0.1E0,0.4E0),
118-
+ (0.4E0,0.1E0), (0.1E0,0.2E0), (2.0E0,3.0E0),
159+
+ (7.0E0,8.0E0), (0.3E0,0.1E0), (0.5E0,0.0E0),
160+
+ (0.0E0,0.5E0), (0.0E0,0.2E0), (2.0E0,3.0E0),
119161
+ (2.0E0,3.0E0), (2.0E0,3.0E0), (2.0E0,3.0E0)/
120162
DATA ((CV(I,J,2),I=1,8),J=1,5)/(0.1E0,0.1E0),
121163
+ (4.0E0,5.0E0), (4.0E0,5.0E0), (4.0E0,5.0E0),
@@ -129,10 +171,10 @@ SUBROUTINE CHECK1(SFAC)
129171
+ (3.0E0,6.0E0), (-0.6E0,0.1E0), (4.0E0,7.0E0),
130172
+ (0.1E0,-0.3E0), (7.0E0,2.0E0), (7.0E0,2.0E0),
131173
+ (7.0E0,2.0E0), (0.3E0,0.1E0), (5.0E0,8.0E0),
132-
+ (0.1E0,0.4E0), (6.0E0,9.0E0), (0.4E0,0.1E0),
133-
+ (8.0E0,3.0E0), (0.1E0,0.2E0), (9.0E0,4.0E0)/
134-
DATA STRUE2/0.0E0, 0.5E0, 0.6E0, 0.7E0, 0.7E0/
135-
DATA STRUE4/0.0E0, 0.7E0, 1.0E0, 1.3E0, 1.7E0/
174+
+ (0.5E0,0.0E0), (6.0E0,9.0E0), (0.0E0,0.5E0),
175+
+ (8.0E0,3.0E0), (0.0E0,0.2E0), (9.0E0,4.0E0)/
176+
DATA STRUE2/0.0E0, 0.5E0, 0.6E0, 0.7E0, 0.8E0/
177+
DATA STRUE4/0.0E0, 0.7E0, 1.0E0, 1.3E0, 1.6E0/
136178
DATA ((CTRUE5(I,J,1),I=1,8),J=1,5)/(0.1E0,0.1E0),
137179
+ (1.0E0,2.0E0), (1.0E0,2.0E0), (1.0E0,2.0E0),
138180
+ (1.0E0,2.0E0), (1.0E0,2.0E0), (1.0E0,2.0E0),
@@ -145,8 +187,8 @@ SUBROUTINE CHECK1(SFAC)
145187
+ (0.11E0,-0.03E0), (-0.17E0,0.46E0),
146188
+ (-0.17E0,-0.19E0), (7.0E0,8.0E0), (7.0E0,8.0E0),
147189
+ (7.0E0,8.0E0), (7.0E0,8.0E0), (7.0E0,8.0E0),
148-
+ (0.19E0,-0.17E0), (0.32E0,0.09E0),
149-
+ (0.23E0,-0.24E0), (0.18E0,0.01E0),
190+
+ (0.19E0,-0.17E0), (0.20E0,-0.35E0),
191+
+ (0.35E0,0.20E0), (0.14E0,0.08E0),
150192
+ (2.0E0,3.0E0), (2.0E0,3.0E0), (2.0E0,3.0E0),
151193
+ (2.0E0,3.0E0)/
152194
DATA ((CTRUE5(I,J,2),I=1,8),J=1,5)/(0.1E0,0.1E0),
@@ -162,9 +204,9 @@ SUBROUTINE CHECK1(SFAC)
162204
+ (-0.17E0,0.46E0), (4.0E0,7.0E0),
163205
+ (-0.17E0,-0.19E0), (7.0E0,2.0E0), (7.0E0,2.0E0),
164206
+ (7.0E0,2.0E0), (0.19E0,-0.17E0), (5.0E0,8.0E0),
165-
+ (0.32E0,0.09E0), (6.0E0,9.0E0),
166-
+ (0.23E0,-0.24E0), (8.0E0,3.0E0),
167-
+ (0.18E0,0.01E0), (9.0E0,4.0E0)/
207+
+ (0.20E0,-0.35E0), (6.0E0,9.0E0),
208+
+ (0.35E0,0.20E0), (8.0E0,3.0E0),
209+
+ (0.14E0,0.08E0), (9.0E0,4.0E0)/
168210
DATA ((CTRUE6(I,J,1),I=1,8),J=1,5)/(0.1E0,0.1E0),
169211
+ (1.0E0,2.0E0), (1.0E0,2.0E0), (1.0E0,2.0E0),
170212
+ (1.0E0,2.0E0), (1.0E0,2.0E0), (1.0E0,2.0E0),
@@ -177,8 +219,8 @@ SUBROUTINE CHECK1(SFAC)
177219
+ (0.03E0,0.03E0), (-0.18E0,0.03E0),
178220
+ (0.03E0,-0.09E0), (7.0E0,8.0E0), (7.0E0,8.0E0),
179221
+ (7.0E0,8.0E0), (7.0E0,8.0E0), (7.0E0,8.0E0),
180-
+ (0.09E0,0.03E0), (0.03E0,0.12E0),
181-
+ (0.12E0,0.03E0), (0.03E0,0.06E0), (2.0E0,3.0E0),
222+
+ (0.09E0,0.03E0), (0.15E0,0.00E0),
223+
+ (0.00E0,0.15E0), (0.00E0,0.06E0), (2.0E0,3.0E0),
182224
+ (2.0E0,3.0E0), (2.0E0,3.0E0), (2.0E0,3.0E0)/
183225
DATA ((CTRUE6(I,J,2),I=1,8),J=1,5)/(0.1E0,0.1E0),
184226
+ (4.0E0,5.0E0), (4.0E0,5.0E0), (4.0E0,5.0E0),
@@ -193,8 +235,8 @@ SUBROUTINE CHECK1(SFAC)
193235
+ (-0.18E0,0.03E0), (4.0E0,7.0E0),
194236
+ (0.03E0,-0.09E0), (7.0E0,2.0E0), (7.0E0,2.0E0),
195237
+ (7.0E0,2.0E0), (0.09E0,0.03E0), (5.0E0,8.0E0),
196-
+ (0.03E0,0.12E0), (6.0E0,9.0E0), (0.12E0,0.03E0),
197-
+ (8.0E0,3.0E0), (0.03E0,0.06E0), (9.0E0,4.0E0)/
238+
+ (0.15E0,0.00E0), (6.0E0,9.0E0), (0.00E0,0.15E0),
239+
+ (8.0E0,3.0E0), (0.00E0,0.06E0), (9.0E0,4.0E0)/
198240
DATA ITRUE3/0, 1, 2, 2, 2/
199241
* .. Executable Statements ..
200242
DO 60 INCX = 1, 2
@@ -529,7 +571,8 @@ SUBROUTINE STEST(LEN,SCOMP,STRUE,SSIZE,SFAC)
529571
*
530572
* .. Parameters ..
531573
INTEGER NOUT
532-
PARAMETER (NOUT=6)
574+
REAL ZERO
575+
PARAMETER (NOUT=6, ZERO=0.0E0)
533576
* .. Scalar Arguments ..
534577
REAL SFAC
535578
INTEGER LEN
@@ -552,7 +595,7 @@ SUBROUTINE STEST(LEN,SCOMP,STRUE,SSIZE,SFAC)
552595
*
553596
DO 40 I = 1, LEN
554597
SD = SCOMP(I) - STRUE(I)
555-
IF (SDIFF(ABS(SSIZE(I))+ABS(SFAC*SD),ABS(SSIZE(I))).EQ.0.0E0)
598+
IF (ABS(SFAC*SD) .LE. ABS(SSIZE(I))*EPSILON(ZERO))
556599
+ GO TO 40
557600
*
558601
* HERE SCOMP(I) IS NOT CLOSE TO STRUE(I).

test/cblat2.f

Lines changed: 113 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,114 @@
1+
*> \brief \b CBLAT2
2+
*
3+
* =========== DOCUMENTATION ===========
4+
*
5+
* Online html documentation available at
6+
* http://www.netlib.org/lapack/explore-html/
7+
*
8+
* Definition:
9+
* ===========
10+
*
11+
* PROGRAM CBLAT2
12+
*
13+
*
14+
*> \par Purpose:
15+
* =============
16+
*>
17+
*> \verbatim
18+
*>
19+
*> Test program for the COMPLEX Level 2 Blas.
20+
*>
21+
*> The program must be driven by a short data file. The first 18 records
22+
*> of the file are read using list-directed input, the last 17 records
23+
*> are read using the format ( A6, L2 ). An annotated example of a data
24+
*> file can be obtained by deleting the first 3 characters from the
25+
*> following 35 lines:
26+
*> 'cblat2.out' NAME OF SUMMARY OUTPUT FILE
27+
*> 6 UNIT NUMBER OF SUMMARY FILE
28+
*> 'CBLA2T.SNAP' NAME OF SNAPSHOT OUTPUT FILE
29+
*> -1 UNIT NUMBER OF SNAPSHOT FILE (NOT USED IF .LT. 0)
30+
*> F LOGICAL FLAG, T TO REWIND SNAPSHOT FILE AFTER EACH RECORD.
31+
*> F LOGICAL FLAG, T TO STOP ON FAILURES.
32+
*> T LOGICAL FLAG, T TO TEST ERROR EXITS.
33+
*> 16.0 THRESHOLD VALUE OF TEST RATIO
34+
*> 6 NUMBER OF VALUES OF N
35+
*> 0 1 2 3 5 9 VALUES OF N
36+
*> 4 NUMBER OF VALUES OF K
37+
*> 0 1 2 4 VALUES OF K
38+
*> 4 NUMBER OF VALUES OF INCX AND INCY
39+
*> 1 2 -1 -2 VALUES OF INCX AND INCY
40+
*> 3 NUMBER OF VALUES OF ALPHA
41+
*> (0.0,0.0) (1.0,0.0) (0.7,-0.9) VALUES OF ALPHA
42+
*> 3 NUMBER OF VALUES OF BETA
43+
*> (0.0,0.0) (1.0,0.0) (1.3,-1.1) VALUES OF BETA
44+
*> CGEMV T PUT F FOR NO TEST. SAME COLUMNS.
45+
*> CGBMV T PUT F FOR NO TEST. SAME COLUMNS.
46+
*> CHEMV T PUT F FOR NO TEST. SAME COLUMNS.
47+
*> CHBMV T PUT F FOR NO TEST. SAME COLUMNS.
48+
*> CHPMV T PUT F FOR NO TEST. SAME COLUMNS.
49+
*> CTRMV T PUT F FOR NO TEST. SAME COLUMNS.
50+
*> CTBMV T PUT F FOR NO TEST. SAME COLUMNS.
51+
*> CTPMV T PUT F FOR NO TEST. SAME COLUMNS.
52+
*> CTRSV T PUT F FOR NO TEST. SAME COLUMNS.
53+
*> CTBSV T PUT F FOR NO TEST. SAME COLUMNS.
54+
*> CTPSV T PUT F FOR NO TEST. SAME COLUMNS.
55+
*> CGERC T PUT F FOR NO TEST. SAME COLUMNS.
56+
*> CGERU T PUT F FOR NO TEST. SAME COLUMNS.
57+
*> CHER T PUT F FOR NO TEST. SAME COLUMNS.
58+
*> CHPR T PUT F FOR NO TEST. SAME COLUMNS.
59+
*> CHER2 T PUT F FOR NO TEST. SAME COLUMNS.
60+
*> CHPR2 T PUT F FOR NO TEST. SAME COLUMNS.
61+
*>
62+
*> Further Details
63+
*> ===============
64+
*>
65+
*> See:
66+
*>
67+
*> Dongarra J. J., Du Croz J. J., Hammarling S. and Hanson R. J..
68+
*> An extended set of Fortran Basic Linear Algebra Subprograms.
69+
*>
70+
*> Technical Memoranda Nos. 41 (revision 3) and 81, Mathematics
71+
*> and Computer Science Division, Argonne National Laboratory,
72+
*> 9700 South Cass Avenue, Argonne, Illinois 60439, US.
73+
*>
74+
*> Or
75+
*>
76+
*> NAG Technical Reports TR3/87 and TR4/87, Numerical Algorithms
77+
*> Group Ltd., NAG Central Office, 256 Banbury Road, Oxford
78+
*> OX2 7DE, UK, and Numerical Algorithms Group Inc., 1101 31st
79+
*> Street, Suite 100, Downers Grove, Illinois 60515-1263, USA.
80+
*>
81+
*>
82+
*> -- Written on 10-August-1987.
83+
*> Richard Hanson, Sandia National Labs.
84+
*> Jeremy Du Croz, NAG Central Office.
85+
*>
86+
*> 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
87+
*> can be run multiple times without deleting generated
88+
*> output files (susan)
89+
*> \endverbatim
90+
*
91+
* Authors:
92+
* ========
93+
*
94+
*> \author Univ. of Tennessee
95+
*> \author Univ. of California Berkeley
96+
*> \author Univ. of Colorado Denver
97+
*> \author NAG Ltd.
98+
*
99+
*> \date April 2012
100+
*
101+
*> \ingroup complex_blas_testing
102+
*
103+
* =====================================================================
1104
PROGRAM CBLAT2
2105
*
3-
* Test program for the COMPLEX Level 2 Blas.
4-
*
5-
* The program must be driven by a short data file. The first 18 records
6-
* of the file are read using list-directed input, the last 17 records
7-
* are read using the format ( A6, L2 ). An annotated example of a data
8-
* file can be obtained by deleting the first 3 characters from the
9-
* following 35 lines:
10-
* 'CBLAT2.SUMM' NAME OF SUMMARY OUTPUT FILE
11-
* 6 UNIT NUMBER OF SUMMARY FILE
12-
* 'CBLA2T.SNAP' NAME OF SNAPSHOT OUTPUT FILE
13-
* -1 UNIT NUMBER OF SNAPSHOT FILE (NOT USED IF .LT. 0)
14-
* F LOGICAL FLAG, T TO REWIND SNAPSHOT FILE AFTER EACH RECORD.
15-
* F LOGICAL FLAG, T TO STOP ON FAILURES.
16-
* T LOGICAL FLAG, T TO TEST ERROR EXITS.
17-
* 16.0 THRESHOLD VALUE OF TEST RATIO
18-
* 6 NUMBER OF VALUES OF N
19-
* 0 1 2 3 5 9 VALUES OF N
20-
* 4 NUMBER OF VALUES OF K
21-
* 0 1 2 4 VALUES OF K
22-
* 4 NUMBER OF VALUES OF INCX AND INCY
23-
* 1 2 -1 -2 VALUES OF INCX AND INCY
24-
* 3 NUMBER OF VALUES OF ALPHA
25-
* (0.0,0.0) (1.0,0.0) (0.7,-0.9) VALUES OF ALPHA
26-
* 3 NUMBER OF VALUES OF BETA
27-
* (0.0,0.0) (1.0,0.0) (1.3,-1.1) VALUES OF BETA
28-
* CGEMV T PUT F FOR NO TEST. SAME COLUMNS.
29-
* CGBMV T PUT F FOR NO TEST. SAME COLUMNS.
30-
* CHEMV T PUT F FOR NO TEST. SAME COLUMNS.
31-
* CHBMV T PUT F FOR NO TEST. SAME COLUMNS.
32-
* CHPMV T PUT F FOR NO TEST. SAME COLUMNS.
33-
* CTRMV T PUT F FOR NO TEST. SAME COLUMNS.
34-
* CTBMV T PUT F FOR NO TEST. SAME COLUMNS.
35-
* CTPMV T PUT F FOR NO TEST. SAME COLUMNS.
36-
* CTRSV T PUT F FOR NO TEST. SAME COLUMNS.
37-
* CTBSV T PUT F FOR NO TEST. SAME COLUMNS.
38-
* CTPSV T PUT F FOR NO TEST. SAME COLUMNS.
39-
* CGERC T PUT F FOR NO TEST. SAME COLUMNS.
40-
* CGERU T PUT F FOR NO TEST. SAME COLUMNS.
41-
* CHER T PUT F FOR NO TEST. SAME COLUMNS.
42-
* CHPR T PUT F FOR NO TEST. SAME COLUMNS.
43-
* CHER2 T PUT F FOR NO TEST. SAME COLUMNS.
44-
* CHPR2 T PUT F FOR NO TEST. SAME COLUMNS.
45-
*
46-
* See:
47-
*
48-
* Dongarra J. J., Du Croz J. J., Hammarling S. and Hanson R. J..
49-
* An extended set of Fortran Basic Linear Algebra Subprograms.
50-
*
51-
* Technical Memoranda Nos. 41 (revision 3) and 81, Mathematics
52-
* and Computer Science Division, Argonne National Laboratory,
53-
* 9700 South Cass Avenue, Argonne, Illinois 60439, US.
54-
*
55-
* Or
56-
*
57-
* NAG Technical Reports TR3/87 and TR4/87, Numerical Algorithms
58-
* Group Ltd., NAG Central Office, 256 Banbury Road, Oxford
59-
* OX2 7DE, UK, and Numerical Algorithms Group Inc., 1101 31st
60-
* Street, Suite 100, Downers Grove, Illinois 60515-1263, USA.
106+
* -- Reference BLAS test routine (version 3.7.0) --
107+
* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
108+
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
109+
* April 2012
61110
*
62-
*
63-
* -- Written on 10-August-1987.
64-
* Richard Hanson, Sandia National Labs.
65-
* Jeremy Du Croz, NAG Central Office.
111+
* =====================================================================
66112
*
67113
* .. Parameters ..
68114
INTEGER NIN
@@ -71,8 +117,8 @@ PROGRAM CBLAT2
71117
PARAMETER ( NSUBS = 17 )
72118
COMPLEX ZERO, ONE
73119
PARAMETER ( ZERO = ( 0.0, 0.0 ), ONE = ( 1.0, 0.0 ) )
74-
REAL RZERO, RHALF, RONE
75-
PARAMETER ( RZERO = 0.0, RHALF = 0.5, RONE = 1.0 )
120+
REAL RZERO
121+
PARAMETER ( RZERO = 0.0 )
76122
INTEGER NMAX, INCMAX
77123
PARAMETER ( NMAX = 65, INCMAX = 2 )
78124
INTEGER NINMAX, NIDMAX, NKBMAX, NALMAX, NBEMAX
@@ -126,7 +172,7 @@ PROGRAM CBLAT2
126172
*
127173
READ( NIN, FMT = * )SUMMRY
128174
READ( NIN, FMT = * )NOUT
129-
OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
175+
OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
130176
NOUTC = NOUT
131177
*
132178
* Read name and unit number for snapshot output file and open file.
@@ -135,7 +181,7 @@ PROGRAM CBLAT2
135181
READ( NIN, FMT = * )NTRA
136182
TRACE = NTRA.GE.0
137183
IF( TRACE )THEN
138-
OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
184+
OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
139185
END IF
140186
* Read the flag that directs rewinding of the snapshot file.
141187
READ( NIN, FMT = * )REWI
@@ -240,14 +286,7 @@ PROGRAM CBLAT2
240286
*
241287
* Compute EPS (the machine precision).
242288
*
243-
EPS = RONE
244-
90 CONTINUE
245-
IF( SDIFF( RONE + EPS, RONE ).EQ.RZERO )
246-
$ GO TO 100
247-
EPS = RHALF*EPS
248-
GO TO 90
249-
100 CONTINUE
250-
EPS = EPS + EPS
289+
EPS = EPSILON(RZERO)
251290
WRITE( NOUT, FMT = 9998 )EPS
252291
*
253292
* Check the reliability of CMVCH using exact data.
@@ -3079,7 +3118,6 @@ LOGICAL FUNCTION LCERES( TYPE, UPLO, M, N, AA, AS, LDA )
30793118
50 CONTINUE
30803119
END IF
30813120
*
3082-
60 CONTINUE
30833121
LCERES = .TRUE.
30843122
GO TO 80
30853123
70 CONTINUE

0 commit comments

Comments
 (0)