LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ cchk6()

subroutine cchk6 ( character*13 sname,
real eps,
real thresh,
integer nout,
integer ntra,
logical trace,
logical rewi,
logical fatal,
integer nidim,
integer, dimension( nidim ) idim,
integer nalf,
complex, dimension( nalf ) alf,
integer nbet,
complex, dimension( nbet ) bet,
integer nmax,
complex, dimension( nmax, nmax ) a,
complex, dimension( nmax*nmax ) aa,
complex, dimension( nmax*nmax ) as,
complex, dimension( nmax, nmax ) b,
complex, dimension( nmax*nmax ) bb,
complex, dimension( nmax*nmax ) bs,
complex, dimension( nmax, nmax ) c,
complex, dimension( nmax*nmax ) cc,
complex, dimension( nmax*nmax ) cs,
complex, dimension( nmax ) ct,
real, dimension( nmax ) g,
integer iorder )

Definition at line 2805 of file c_cblat3.f.

2809 IMPLICIT NONE
2810*
2811* Tests CGEMMTR.
2812*
2813* Auxiliary routine for test program for Level 3 Blas.
2814*
2815* -- Written on 24-June-2024.
2816* Martin Koehler, Max Planck Institute Magdeburg
2817*
2818* .. Parameters ..
2819 COMPLEX ZERO
2820 parameter( zero = ( 0.0, 0.0 ) )
2821 REAL RZERO
2822 parameter( rzero = 0.0 )
2823* .. Scalar Arguments ..
2824 REAL EPS, THRESH
2825 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
2826 LOGICAL FATAL, REWI, TRACE
2827 CHARACTER*13 SNAME
2828* .. Array Arguments ..
2829 COMPLEX A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
2830 $ AS( NMAX*NMAX ), B( NMAX, NMAX ),
2831 $ BB( NMAX*NMAX ), BET( NBET ), BS( NMAX*NMAX ),
2832 $ C( NMAX, NMAX ), CC( NMAX*NMAX ),
2833 $ CS( NMAX*NMAX ), CT( NMAX )
2834 REAL G( NMAX )
2835 INTEGER IDIM( NIDIM )
2836* .. Local Scalars ..
2837 COMPLEX ALPHA, ALS, BETA, BLS
2838 REAL ERR, ERRMAX
2839 INTEGER I, IA, IB, ICA, ICB, IK, IM, IN, K, KS, LAA,
2840 $ LBB, LCC, LDA, LDAS, LDB, LDBS, LDC, LDCS,
2841 $ MA, MB, N, NA, NARGS, NB, NC, NS, IS
2842 LOGICAL NULL, RESET, SAME, TRANA, TRANB
2843 CHARACTER*1 TRANAS, TRANBS, TRANSA, TRANSB, UPLO, UPLOS
2844 CHARACTER*3 ICH
2845 CHARACTER*2 ISHAPE
2846* .. Local Arrays ..
2847 LOGICAL ISAME( 13 )
2848* .. External Functions ..
2849 LOGICAL LCE, LCERES
2850 EXTERNAL lce, lceres
2851* .. External Subroutines ..
2852 EXTERNAL ccgemmtr, cmake, cmmtch, cprcn8
2853* .. Intrinsic Functions ..
2854 INTRINSIC max
2855* .. Scalars in Common ..
2856 INTEGER INFOT, NOUTC
2857 LOGICAL LERR, OK
2858* .. Common blocks ..
2859 COMMON /infoc/infot, noutc, ok, lerr
2860* .. Data statements ..
2861 DATA ich/'NTC'/
2862 DATA ishape/'UL'/
2863* .. Executable Statements ..
2864*
2865 nargs = 13
2866 nc = 0
2867 reset = .true.
2868 errmax = rzero
2869*
2870 DO 100 in = 1, nidim
2871 n = idim( in )
2872* Set LDC to 1 more than minimum value if room.
2873 ldc = n
2874 IF( ldc.LT.nmax )
2875 $ ldc = ldc + 1
2876* Skip tests if not enough room.
2877 IF( ldc.GT.nmax )
2878 $ GO TO 100
2879 lcc = ldc*n
2880 null = n.LE.0.
2881*
2882 DO 90 ik = 1, nidim
2883 k = idim( ik )
2884*
2885 DO 80 ica = 1, 3
2886 transa = ich( ica: ica )
2887 trana = transa.EQ.'T'.OR.transa.EQ.'C'
2888*
2889 IF( trana )THEN
2890 ma = k
2891 na = n
2892 ELSE
2893 ma = n
2894 na = k
2895 END IF
2896* Set LDA to 1 more than minimum value if room.
2897 lda = ma
2898 IF( lda.LT.nmax )
2899 $ lda = lda + 1
2900* Skip tests if not enough room.
2901 IF( lda.GT.nmax )
2902 $ GO TO 80
2903 laa = lda*na
2904*
2905* Generate the matrix A.
2906*
2907 CALL cmake( 'ge', ' ', ' ', ma, na, a, nmax, aa, lda,
2908 $ reset, zero )
2909*
2910 DO 70 icb = 1, 3
2911 transb = ich( icb: icb )
2912 tranb = transb.EQ.'T'.OR.transb.EQ.'C'
2913*
2914 IF( tranb )THEN
2915 mb = n
2916 nb = k
2917 ELSE
2918 mb = k
2919 nb = n
2920 END IF
2921* Set LDB to 1 more than minimum value if room.
2922 ldb = mb
2923 IF( ldb.LT.nmax )
2924 $ ldb = ldb + 1
2925* Skip tests if not enough room.
2926 IF( ldb.GT.nmax )
2927 $ GO TO 70
2928 lbb = ldb*nb
2929*
2930* Generate the matrix B.
2931*
2932 CALL cmake( 'ge', ' ', ' ', mb, nb, b, nmax, bb,
2933 $ ldb, reset, zero )
2934*
2935 DO 60 ia = 1, nalf
2936 alpha = alf( ia )
2937*
2938 DO 50 ib = 1, nbet
2939 beta = bet( ib )
2940 DO 45 is = 1, 2
2941 uplo = ishape(is:is)
2942*
2943* Generate the matrix C.
2944*
2945 CALL cmake( 'ge', uplo, ' ', n, n, c, nmax,
2946 $ cc, ldc, reset, zero )
2947*
2948 nc = nc + 1
2949*
2950* Save every datum before calling the
2951* subroutine.
2952*
2953 uplos = uplo
2954 tranas = transa
2955 tranbs = transb
2956 ns = n
2957 ks = k
2958 als = alpha
2959 DO 10 i = 1, laa
2960 as( i ) = aa( i )
2961 10 CONTINUE
2962 ldas = lda
2963 DO 20 i = 1, lbb
2964 bs( i ) = bb( i )
2965 20 CONTINUE
2966 ldbs = ldb
2967 bls = beta
2968 DO 30 i = 1, lcc
2969 cs( i ) = cc( i )
2970 30 CONTINUE
2971 ldcs = ldc
2972*
2973* Call the subroutine.
2974*
2975 IF( trace )
2976 $ CALL cprcn8(ntra, nc, sname, iorder, uplo,
2977 $ transa, transb, n, k, alpha, lda,
2978 $ ldb, beta, ldc)
2979 IF( rewi )
2980 $ rewind ntra
2981 CALL ccgemmtr(iorder, uplo, transa, transb,
2982 $ n, k, alpha, aa, lda, bb, ldb,
2983 $ beta, cc, ldc )
2984*
2985* Check if error-exit was taken incorrectly.
2986*
2987 IF( .NOT.ok )THEN
2988 WRITE( nout, fmt = 9994 )
2989 fatal = .true.
2990 GO TO 120
2991 END IF
2992*
2993* See what data changed inside subroutines.
2994*
2995 isame( 1 ) = uplo .EQ. uplos
2996 isame( 2 ) = transa.EQ.tranas
2997 isame( 3 ) = transb.EQ.tranbs
2998 isame( 4 ) = ns.EQ.n
2999 isame( 5 ) = ks.EQ.k
3000 isame( 6 ) = als.EQ.alpha
3001 isame( 7 ) = lce( as, aa, laa )
3002 isame( 8 ) = ldas.EQ.lda
3003 isame( 9 ) = lce( bs, bb, lbb )
3004 isame( 10 ) = ldbs.EQ.ldb
3005 isame( 11 ) = bls.EQ.beta
3006 IF( null )THEN
3007 isame( 12 ) = lce( cs, cc, lcc )
3008 ELSE
3009 isame( 12 ) = lceres( 'ge', ' ', n, n, cs,
3010 $ cc, ldc )
3011 END IF
3012 isame( 13 ) = ldcs.EQ.ldc
3013*
3014* If data was incorrectly changed, report
3015* and return.
3016*
3017 same = .true.
3018 DO 40 i = 1, nargs
3019 same = same.AND.isame( i )
3020 IF( .NOT.isame( i ) )
3021 $ WRITE( nout, fmt = 9998 )i
3022 40 CONTINUE
3023 IF( .NOT.same )THEN
3024 fatal = .true.
3025 GO TO 120
3026 END IF
3027*
3028 IF( .NOT.null )THEN
3029*
3030* Check the result.
3031*
3032 CALL cmmtch( uplo, transa, transb, n, k,
3033 $ alpha, a, nmax, b, nmax, beta,
3034 $ c, nmax, ct, g, cc, ldc, eps,
3035 $ err, fatal, nout, .true. )
3036 errmax = max( errmax, err )
3037* If got really bad answer, report and
3038* return.
3039 IF( fatal )
3040 $ GO TO 120
3041 END IF
3042*
3043 45 CONTINUE
3044*
3045 50 CONTINUE
3046*
3047 60 CONTINUE
3048*
3049 70 CONTINUE
3050*
3051 80 CONTINUE
3052*
3053 90 CONTINUE
3054*
3055 100 CONTINUE
3056*
3057*
3058* Report result.
3059*
3060 IF( errmax.LT.thresh )THEN
3061 IF ( iorder.EQ.0) WRITE( nout, fmt = 10000 )sname, nc
3062 IF ( iorder.EQ.1) WRITE( nout, fmt = 10001 )sname, nc
3063 ELSE
3064 IF ( iorder.EQ.0) WRITE( nout, fmt = 10002 )sname, nc, errmax
3065 IF ( iorder.EQ.1) WRITE( nout, fmt = 10003 )sname, nc, errmax
3066 END IF
3067 GO TO 130
3068*
3069 120 CONTINUE
3070 WRITE( nout, fmt = 9996 )sname
3071 CALL cprcn8(nout, nc, sname, iorder, uplo, transa, transb,
3072 $ n, k, alpha, lda, ldb, beta, ldc)
3073*
3074 130 CONTINUE
3075 RETURN
3076*
307710003 FORMAT( ' ', a13,' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
3078 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
3079 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
308010002 FORMAT( ' ', a13,' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
3081 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
3082 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
308310001 FORMAT( ' ', a13,' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
3084 $ ' (', i6, ' CALL', 'S)' )
308510000 FORMAT( ' ', a13,' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
3086 $ ' (', i6, ' CALL', 'S)' )
3087 9998 FORMAT(' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
3088 $ 'ANGED INCORRECTLY *******' )
3089 9996 FORMAT( ' ******* ', a13,' FAILED ON CALL NUMBER:' )
3090 9995 FORMAT( 1x, i6, ': ', a13,'(''', a1, ''',''', a1, ''',',
3091 $ 3( i3, ',' ), '(', f4.1, ',', f4.1, '), A,', i3, ', B,', i3,
3092 $ ',(', f4.1, ',', f4.1, '), C,', i3, ').' )
3093 9994 FORMAT(' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
3094 $ '******' )
3095*
3096* End of CCHK6.
3097*
subroutine cprcn8(nout, nc, sname, iorder, uplo, transa, transb, n, k, alpha, lda, ldb, beta, ldc)
Definition c_cblat3.f:3103
subroutine cmake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)
Definition cblat2.f:2744
logical function lceres(type, uplo, m, n, aa, as, lda)
Definition cblat2.f:3097
logical function lce(ri, rj, lr)
Definition cblat2.f:3067
subroutine cmmtch(uplo, transa, transb, n, kk, alpha, a, lda, b, ldb, beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal, nout, mv)
Definition cblat3.f:3986
Here is the call graph for this function: