1 /*
2  * cblas_test.h
3  * Written by Keita Teranishi
4  */
5 #ifndef CBLAS_TEST_H
6 #define CBLAS_TEST_H
7 #include "cblas.h"
8 
9 #define  TRUE           1
10 #define  PASSED         1
11 #define  TEST_ROW_MJR	1
12 
13 #define  FALSE          0
14 #define  FAILED         0
15 #define  TEST_COL_MJR	0
16 
17 #define  INVALID       -1
18 #define  UNDEFINED     -1
19 
20 typedef struct { float real; float imag; } CBLAS_TEST_COMPLEX;
21 typedef struct { double real; double imag; } CBLAS_TEST_ZOMPLEX;
22 
23 #if defined(ADD_)
24    // Google-local: Note that here we retain the standard name, as we want to
25    // override the existing BLAS/LAPACK version when running tests.
26    #define F77_xerbla xerbla_
27 /*
28  * Level 1 BLAS
29  */
30    #define F77_srotg      srotgtest_
31    #define F77_srotmg     srotmgtest_
32    #define F77_srot       srottest_
33    #define F77_srotm      srotmtest_
34    #define F77_drotg      drotgtest_
35    #define F77_drotmg     drotmgtest_
36    #define F77_drot       drottest_
37    #define F77_drotm      drotmtest_
38    #define F77_sswap      sswaptest_
39    #define F77_scopy      scopytest_
40    #define F77_saxpy      saxpytest_
41    #define F77_isamax     isamaxtest_
42    #define F77_dswap      dswaptest_
43    #define F77_dcopy      dcopytest_
44    #define F77_daxpy      daxpytest_
45    #define F77_idamax     idamaxtest_
46    #define F77_cswap      cswaptest_
47    #define F77_ccopy      ccopytest_
48    #define F77_caxpy      caxpytest_
49    #define F77_icamax     icamaxtest_
50    #define F77_zswap      zswaptest_
51    #define F77_zcopy      zcopytest_
52    #define F77_zaxpy      zaxpytest_
53    #define F77_izamax     izamaxtest_
54    #define F77_sdot       sdottest_
55    #define F77_ddot       ddottest_
56    #define F77_dsdot      dsdottest_
57    #define F77_sscal      sscaltest_
58    #define F77_dscal      dscaltest_
59    #define F77_cscal      cscaltest_
60    #define F77_zscal      zscaltest_
61    #define F77_csscal     csscaltest_
62    #define F77_zdscal      zdscaltest_
63    #define F77_cdotu      cdotutest_
64    #define F77_cdotc      cdotctest_
65    #define F77_zdotu      zdotutest_
66    #define F77_zdotc      zdotctest_
67    #define F77_snrm2      snrm2test_
68    #define F77_sasum      sasumtest_
69    #define F77_dnrm2      dnrm2test_
70    #define F77_dasum      dasumtest_
71    #define F77_scnrm2     scnrm2test_
72    #define F77_scasum     scasumtest_
73    #define F77_dznrm2     dznrm2test_
74    #define F77_dzasum     dzasumtest_
75    #define F77_sdsdot     sdsdottest_
76 /*
77  * Level 2 BLAS
78  */
79    #define F77_s2chke     cs2chke_
80    #define F77_d2chke     cd2chke_
81    #define F77_c2chke     cc2chke_
82    #define F77_z2chke     cz2chke_
83    #define F77_ssymv      cssymv_
84    #define F77_ssbmv      cssbmv_
85    #define F77_sspmv      csspmv_
86    #define F77_sger       csger_
87    #define F77_ssyr       cssyr_
88    #define F77_sspr       csspr_
89    #define F77_ssyr2      cssyr2_
90    #define F77_sspr2      csspr2_
91    #define F77_dsymv      cdsymv_
92    #define F77_dsbmv      cdsbmv_
93    #define F77_dspmv      cdspmv_
94    #define F77_dger       cdger_
95    #define F77_dsyr       cdsyr_
96    #define F77_dspr       cdspr_
97    #define F77_dsyr2      cdsyr2_
98    #define F77_dspr2      cdspr2_
99    #define F77_chemv      cchemv_
100    #define F77_chbmv      cchbmv_
101    #define F77_chpmv      cchpmv_
102    #define F77_cgeru      ccgeru_
103    #define F77_cgerc      ccgerc_
104    #define F77_cher       ccher_
105    #define F77_chpr       cchpr_
106    #define F77_cher2      ccher2_
107    #define F77_chpr2      cchpr2_
108    #define F77_zhemv      czhemv_
109    #define F77_zhbmv      czhbmv_
110    #define F77_zhpmv      czhpmv_
111    #define F77_zgeru      czgeru_
112    #define F77_zgerc      czgerc_
113    #define F77_zher       czher_
114    #define F77_zhpr       czhpr_
115    #define F77_zher2      czher2_
116    #define F77_zhpr2      czhpr2_
117    #define F77_sgemv      csgemv_
118    #define F77_sgbmv      csgbmv_
119    #define F77_strmv      cstrmv_
120    #define F77_stbmv      cstbmv_
121    #define F77_stpmv      cstpmv_
122    #define F77_strsv      cstrsv_
123    #define F77_stbsv      cstbsv_
124    #define F77_stpsv      cstpsv_
125    #define F77_dgemv      cdgemv_
126    #define F77_dgbmv      cdgbmv_
127    #define F77_dtrmv      cdtrmv_
128    #define F77_dtbmv      cdtbmv_
129    #define F77_dtpmv      cdtpmv_
130    #define F77_dtrsv      cdtrsv_
131    #define F77_dtbsv      cdtbsv_
132    #define F77_dtpsv      cdtpsv_
133    #define F77_cgemv      ccgemv_
134    #define F77_cgbmv      ccgbmv_
135    #define F77_ctrmv      cctrmv_
136    #define F77_ctbmv      cctbmv_
137    #define F77_ctpmv      cctpmv_
138    #define F77_ctrsv      cctrsv_
139    #define F77_ctbsv      cctbsv_
140    #define F77_ctpsv      cctpsv_
141    #define F77_zgemv      czgemv_
142    #define F77_zgbmv      czgbmv_
143    #define F77_ztrmv      cztrmv_
144    #define F77_ztbmv      cztbmv_
145    #define F77_ztpmv      cztpmv_
146    #define F77_ztrsv      cztrsv_
147    #define F77_ztbsv      cztbsv_
148    #define F77_ztpsv      cztpsv_
149 /*
150  * Level 3 BLAS
151  */
152    #define F77_s3chke     cs3chke_
153    #define F77_d3chke     cd3chke_
154    #define F77_c3chke     cc3chke_
155    #define F77_z3chke     cz3chke_
156    #define F77_chemm      cchemm_
157    #define F77_cherk      ccherk_
158    #define F77_cher2k     ccher2k_
159    #define F77_zhemm      czhemm_
160    #define F77_zherk      czherk_
161    #define F77_zher2k     czher2k_
162    #define F77_sgemm      csgemm_
163    #define F77_ssymm      cssymm_
164    #define F77_ssyrk      cssyrk_
165    #define F77_ssyr2k     cssyr2k_
166    #define F77_strmm      cstrmm_
167    #define F77_strsm      cstrsm_
168    #define F77_dgemm      cdgemm_
169    #define F77_dsymm      cdsymm_
170    #define F77_dsyrk      cdsyrk_
171    #define F77_dsyr2k     cdsyr2k_
172    #define F77_dtrmm      cdtrmm_
173    #define F77_dtrsm      cdtrsm_
174    #define F77_cgemm      ccgemm_
175    #define F77_csymm      ccsymm_
176    #define F77_csyrk      ccsyrk_
177    #define F77_csyr2k     ccsyr2k_
178    #define F77_ctrmm      cctrmm_
179    #define F77_ctrsm      cctrsm_
180    #define F77_zgemm      czgemm_
181    #define F77_zsymm      czsymm_
182    #define F77_zsyrk      czsyrk_
183    #define F77_zsyr2k     czsyr2k_
184    #define F77_ztrmm      cztrmm_
185    #define F77_ztrsm      cztrsm_
186 #elif defined(UPCASE)
187    #define F77_xerbla  XERBLA
188 /*
189  * Level 1 BLAS
190  */
191    #define F77_srotg      SROTGTEST
192    #define F77_srotmg     SROTMGTEST
193    #define F77_srot       SROTCTEST
194    #define F77_srotm      SROTMTEST
195    #define F77_drotg      DROTGTEST
196    #define F77_drotmg     DROTMGTEST
197    #define F77_drot       DROTTEST
198    #define F77_drotm      DROTMTEST
199    #define F77_sswap      SSWAPTEST
200    #define F77_scopy      SCOPYTEST
201    #define F77_saxpy      SAXPYTEST
202    #define F77_isamax     ISAMAXTEST
203    #define F77_dswap      DSWAPTEST
204    #define F77_dcopy      DCOPYTEST
205    #define F77_daxpy      DAXPYTEST
206    #define F77_idamax     IDAMAXTEST
207    #define F77_cswap      CSWAPTEST
208    #define F77_ccopy      CCOPYTEST
209    #define F77_caxpy      CAXPYTEST
210    #define F77_icamax     ICAMAXTEST
211    #define F77_zswap      ZSWAPTEST
212    #define F77_zcopy      ZCOPYTEST
213    #define F77_zaxpy      ZAXPYTEST
214    #define F77_izamax     IZAMAXTEST
215    #define F77_sdot       SDOTTEST
216    #define F77_ddot       DDOTTEST
217    #define F77_dsdot       DSDOTTEST
218    #define F77_sscal      SSCALTEST
219    #define F77_dscal      DSCALTEST
220    #define F77_cscal      CSCALTEST
221    #define F77_zscal      ZSCALTEST
222    #define F77_csscal      CSSCALTEST
223    #define F77_zdscal      ZDSCALTEST
224    #define F77_cdotu      CDOTUTEST
225    #define F77_cdotc      CDOTCTEST
226    #define F77_zdotu      ZDOTUTEST
227    #define F77_zdotc      ZDOTCTEST
228    #define F77_snrm2      SNRM2TEST
229    #define F77_sasum      SASUMTEST
230    #define F77_dnrm2      DNRM2TEST
231    #define F77_dasum      DASUMTEST
232    #define F77_scnrm2      SCNRM2TEST
233    #define F77_scasum      SCASUMTEST
234    #define F77_dznrm2      DZNRM2TEST
235    #define F77_dzasum      DZASUMTEST
236    #define F77_sdsdot       SDSDOTTEST
237 /*
238  * Level 2 BLAS
239  */
240    #define F77_s2chke     CS2CHKE
241    #define F77_d2chke     CD2CHKE
242    #define F77_c2chke     CC2CHKE
243    #define F77_z2chke     CZ2CHKE
244    #define F77_ssymv      CSSYMV
245    #define F77_ssbmv      CSSBMV
246    #define F77_sspmv      CSSPMV
247    #define F77_sger       CSGER
248    #define F77_ssyr       CSSYR
249    #define F77_sspr       CSSPR
250    #define F77_ssyr2      CSSYR2
251    #define F77_sspr2      CSSPR2
252    #define F77_dsymv      CDSYMV
253    #define F77_dsbmv      CDSBMV
254    #define F77_dspmv      CDSPMV
255    #define F77_dger       CDGER
256    #define F77_dsyr       CDSYR
257    #define F77_dspr       CDSPR
258    #define F77_dsyr2      CDSYR2
259    #define F77_dspr2      CDSPR2
260    #define F77_chemv      CCHEMV
261    #define F77_chbmv      CCHBMV
262    #define F77_chpmv      CCHPMV
263    #define F77_cgeru      CCGERU
264    #define F77_cgerc      CCGERC
265    #define F77_cher       CCHER
266    #define F77_chpr       CCHPR
267    #define F77_cher2      CCHER2
268    #define F77_chpr2      CCHPR2
269    #define F77_zhemv      CZHEMV
270    #define F77_zhbmv      CZHBMV
271    #define F77_zhpmv      CZHPMV
272    #define F77_zgeru      CZGERU
273    #define F77_zgerc      CZGERC
274    #define F77_zher       CZHER
275    #define F77_zhpr       CZHPR
276    #define F77_zher2      CZHER2
277    #define F77_zhpr2      CZHPR2
278    #define F77_sgemv      CSGEMV
279    #define F77_sgbmv      CSGBMV
280    #define F77_strmv      CSTRMV
281    #define F77_stbmv      CSTBMV
282    #define F77_stpmv      CSTPMV
283    #define F77_strsv      CSTRSV
284    #define F77_stbsv      CSTBSV
285    #define F77_stpsv      CSTPSV
286    #define F77_dgemv      CDGEMV
287    #define F77_dgbmv      CDGBMV
288    #define F77_dtrmv      CDTRMV
289    #define F77_dtbmv      CDTBMV
290    #define F77_dtpmv      CDTPMV
291    #define F77_dtrsv      CDTRSV
292    #define F77_dtbsv      CDTBSV
293    #define F77_dtpsv      CDTPSV
294    #define F77_cgemv      CCGEMV
295    #define F77_cgbmv      CCGBMV
296    #define F77_ctrmv      CCTRMV
297    #define F77_ctbmv      CCTBMV
298    #define F77_ctpmv      CCTPMV
299    #define F77_ctrsv      CCTRSV
300    #define F77_ctbsv      CCTBSV
301    #define F77_ctpsv      CCTPSV
302    #define F77_zgemv      CZGEMV
303    #define F77_zgbmv      CZGBMV
304    #define F77_ztrmv      CZTRMV
305    #define F77_ztbmv      CZTBMV
306    #define F77_ztpmv      CZTPMV
307    #define F77_ztrsv      CZTRSV
308    #define F77_ztbsv      CZTBSV
309    #define F77_ztpsv      CZTPSV
310 /*
311  * Level 3 BLAS
312  */
313    #define F77_s3chke     CS3CHKE
314    #define F77_d3chke     CD3CHKE
315    #define F77_c3chke     CC3CHKE
316    #define F77_z3chke     CZ3CHKE
317    #define F77_chemm      CCHEMM
318    #define F77_cherk      CCHERK
319    #define F77_cher2k     CCHER2K
320    #define F77_zhemm      CZHEMM
321    #define F77_zherk      CZHERK
322    #define F77_zher2k     CZHER2K
323    #define F77_sgemm      CSGEMM
324    #define F77_ssymm      CSSYMM
325    #define F77_ssyrk      CSSYRK
326    #define F77_ssyr2k     CSSYR2K
327    #define F77_strmm      CSTRMM
328    #define F77_strsm      CSTRSM
329    #define F77_dgemm      CDGEMM
330    #define F77_dsymm      CDSYMM
331    #define F77_dsyrk      CDSYRK
332    #define F77_dsyr2k     CDSYR2K
333    #define F77_dtrmm      CDTRMM
334    #define F77_dtrsm      CDTRSM
335    #define F77_cgemm      CCGEMM
336    #define F77_csymm      CCSYMM
337    #define F77_csyrk      CCSYRK
338    #define F77_csyr2k     CCSYR2K
339    #define F77_ctrmm      CCTRMM
340    #define F77_ctrsm      CCTRSM
341    #define F77_zgemm      CZGEMM
342    #define F77_zsymm      CZSYMM
343    #define F77_zsyrk      CZSYRK
344    #define F77_zsyr2k     CZSYR2K
345    #define F77_ztrmm      CZTRMM
346    #define F77_ztrsm      CZTRSM
347 #elif defined(NOCHANGE)
348    #define F77_xerbla  xerbla
349 /*
350  * Level 1 BLAS
351  */
352    #define F77_srotg      srotgtest
353    #define F77_srotmg     srotmgtest
354    #define F77_srot       srottest
355    #define F77_srotm      srotmtest
356    #define F77_drotg      drotgtest
357    #define F77_drotmg     drotmgtest
358    #define F77_drot       drottest
359    #define F77_drotm      drotmtest
360    #define F77_sswap      sswaptest
361    #define F77_scopy      scopytest
362    #define F77_saxpy      saxpytest
363    #define F77_isamax     isamaxtest
364    #define F77_dswap      dswaptest
365    #define F77_dcopy      dcopytest
366    #define F77_daxpy      daxpytest
367    #define F77_idamax     idamaxtest
368    #define F77_cswap      cswaptest
369    #define F77_ccopy      ccopytest
370    #define F77_caxpy      caxpytest
371    #define F77_icamax     icamaxtest
372    #define F77_zswap      zswaptest
373    #define F77_zcopy      zcopytest
374    #define F77_zaxpy      zaxpytest
375    #define F77_izamax     izamaxtest
376    #define F77_sdot       sdottest
377    #define F77_ddot       ddottest
378    #define F77_dsdot       dsdottest
379    #define F77_sscal      sscaltest
380    #define F77_dscal      dscaltest
381    #define F77_cscal      cscaltest
382    #define F77_zscal      zscaltest
383    #define F77_csscal      csscaltest
384    #define F77_zdscal      zdscaltest
385    #define F77_cdotu  cdotutest
386    #define F77_cdotc  cdotctest
387    #define F77_zdotu  zdotutest
388    #define F77_zdotc  zdotctest
389    #define F77_snrm2  snrm2test
390    #define F77_sasum  sasumtest
391    #define F77_dnrm2  dnrm2test
392    #define F77_dasum  dasumtest
393    #define F77_scnrm2  scnrm2test
394    #define F77_scasum  scasumtest
395    #define F77_dznrm2  dznrm2test
396    #define F77_dzasum  dzasumtest
397    #define F77_sdsdot   sdsdottest
398 /*
399  * Level 2 BLAS
400  */
401    #define F77_s2chke     cs2chke
402    #define F77_d2chke     cd2chke
403    #define F77_c2chke     cc2chke
404    #define F77_z2chke     cz2chke
405    #define F77_ssymv      cssymv
406    #define F77_ssbmv      cssbmv
407    #define F77_sspmv      csspmv
408    #define F77_sger       csger
409    #define F77_ssyr       cssyr
410    #define F77_sspr       csspr
411    #define F77_ssyr2      cssyr2
412    #define F77_sspr2      csspr2
413    #define F77_dsymv      cdsymv
414    #define F77_dsbmv      cdsbmv
415    #define F77_dspmv      cdspmv
416    #define F77_dger       cdger
417    #define F77_dsyr       cdsyr
418    #define F77_dspr       cdspr
419    #define F77_dsyr2      cdsyr2
420    #define F77_dspr2      cdspr2
421    #define F77_chemv      cchemv
422    #define F77_chbmv      cchbmv
423    #define F77_chpmv      cchpmv
424    #define F77_cgeru      ccgeru
425    #define F77_cgerc      ccgerc
426    #define F77_cher       ccher
427    #define F77_chpr       cchpr
428    #define F77_cher2      ccher2
429    #define F77_chpr2      cchpr2
430    #define F77_zhemv      czhemv
431    #define F77_zhbmv      czhbmv
432    #define F77_zhpmv      czhpmv
433    #define F77_zgeru      czgeru
434    #define F77_zgerc      czgerc
435    #define F77_zher       czher
436    #define F77_zhpr       czhpr
437    #define F77_zher2      czher2
438    #define F77_zhpr2      czhpr2
439    #define F77_sgemv      csgemv
440    #define F77_sgbmv      csgbmv
441    #define F77_strmv      cstrmv
442    #define F77_stbmv      cstbmv
443    #define F77_stpmv      cstpmv
444    #define F77_strsv      cstrsv
445    #define F77_stbsv      cstbsv
446    #define F77_stpsv      cstpsv
447    #define F77_dgemv      cdgemv
448    #define F77_dgbmv      cdgbmv
449    #define F77_dtrmv      cdtrmv
450    #define F77_dtbmv      cdtbmv
451    #define F77_dtpmv      cdtpmv
452    #define F77_dtrsv      cdtrsv
453    #define F77_dtbsv      cdtbsv
454    #define F77_dtpsv      cdtpsv
455    #define F77_cgemv      ccgemv
456    #define F77_cgbmv      ccgbmv
457    #define F77_ctrmv      cctrmv
458    #define F77_ctbmv      cctbmv
459    #define F77_ctpmv      cctpmv
460    #define F77_ctrsv      cctrsv
461    #define F77_ctbsv      cctbsv
462    #define F77_ctpsv      cctpsv
463    #define F77_zgemv      czgemv
464    #define F77_zgbmv      czgbmv
465    #define F77_ztrmv      cztrmv
466    #define F77_ztbmv      cztbmv
467    #define F77_ztpmv      cztpmv
468    #define F77_ztrsv      cztrsv
469    #define F77_ztbsv      cztbsv
470    #define F77_ztpsv      cztpsv
471 /*
472  * Level 3 BLAS
473  */
474    #define F77_s3chke     cs3chke
475    #define F77_d3chke     cd3chke
476    #define F77_c3chke     cc3chke
477    #define F77_z3chke     cz3chke
478    #define F77_chemm      cchemm
479    #define F77_cherk      ccherk
480    #define F77_cher2k     ccher2k
481    #define F77_zhemm      czhemm
482    #define F77_zherk      czherk
483    #define F77_zher2k     czher2k
484    #define F77_sgemm      csgemm
485    #define F77_ssymm      cssymm
486    #define F77_ssyrk      cssyrk
487    #define F77_ssyr2k     cssyr2k
488    #define F77_strmm      cstrmm
489    #define F77_strsm      cstrsm
490    #define F77_dgemm      cdgemm
491    #define F77_dsymm      cdsymm
492    #define F77_dsyrk      cdsyrk
493    #define F77_dsyr2k     cdsyr2k
494    #define F77_dtrmm      cdtrmm
495    #define F77_dtrsm      cdtrsm
496    #define F77_cgemm      ccgemm
497    #define F77_csymm      ccsymm
498    #define F77_csyrk      ccsyrk
499    #define F77_csyr2k     ccsyr2k
500    #define F77_ctrmm      cctrmm
501    #define F77_ctrsm      cctrsm
502    #define F77_zgemm      czgemm
503    #define F77_zsymm      czsymm
504    #define F77_zsyrk      czsyrk
505    #define F77_zsyr2k     czsyr2k
506    #define F77_ztrmm      cztrmm
507    #define F77_ztrsm      cztrsm
508 #endif
509 
510 void get_transpose_type(char *type, enum CBLAS_TRANSPOSE *trans);
511 void get_uplo_type(char *type, enum CBLAS_UPLO *uplo);
512 void get_diag_type(char *type, enum CBLAS_DIAG *diag);
513 void get_side_type(char *type, enum CBLAS_SIDE *side);
514 
515 #endif /* CBLAS_TEST_H */
516