OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [vect/] [vect-8.f90] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-require-effective-target vect_double }
3
 
4
module lfk_prec
5
 integer, parameter :: dp=kind(1.d0)
6
end module lfk_prec
7
 
8
!***********************************************
9
 
10
SUBROUTINE kernel(tk)
11
!***********************************************************************
12
!                                                                      *
13
!            KERNEL     executes 24 samples of Fortran computation     *
14
!               TK(1) - total cpu time to execute only the 24 kernels. *
15
!               TK(2) - total Flops executed by the 24 Kernels         *
16
!***********************************************************************
17
!                                                                      *
18
!     L. L. N. L.   F O R T R A N   K E R N E L S:   M F L O P S       *
19
!                                                                      *
20
!   These kernels measure  Fortran  numerical  computation rates for a *
21
!   spectrum of  CPU-limited  computational  structures.  Mathematical *
22
!   through-put is measured  in  units  of  millions of floating-point *
23
!   operations executed per Second, called Mega-Flops/Sec.             *
24
!                                                                      *
25
!   This program  measures  a realistic  CPU performance range for the *
26
!   Fortran programming system  on  a  given day.  The CPU performance *
27
!   rates depend  strongly  on  the maturity of the Fortran compiler's *
28
!   ability to translate Fortran code into efficient machine code.     *
29
!   [ The CPU hardware  capability  apart  from  compiler maturity (or *
30
!   availability), could be measured (or simulated) by programming the *
31
!   kernels in assembly  or machine code directly.  These measurements *
32
!   can also  serve  as a framework for tracking the maturation of the *
33
!   Fortran compiler during system development.]                       *
34
!                                                                      *
35
!     Fonzi's Law: There is not now and there never will be a language *
36
!                  in which it is the least bit difficult to write     *
37
!                  bad programs.                                       *
38
!                                                    F.H.MCMAHON  1972 *
39
!***********************************************************************
40
 
41
!     l1 :=  param-dimension governs the size of most 1-d arrays
42
!     l2 :=  param-dimension governs the size of most 2-d arrays
43
 
44
!     Loop :=  multiple pass control to execute kernel long enough to ti
45
!    me.
46
!     n  :=  DO loop control for each kernel.  Controls are set in subr.
47
!     SIZES
48
 
49
!     ******************************************************************
50
use lfk_prec
51
implicit double precision  (a-h,o-z)
52
!IBM  IMPLICIT  REAL*8           (A-H,O-Z)
53
 
54
REAL(kind=dp), INTENT(inout)                        :: tk
55
INTEGER :: test !!,AND
56
 
57
COMMON/alpha/mk,ik,im,ml,il,mruns,nruns,jr,iovec,npfs(8,3,47)
58
COMMON/beta/tic,times(8,3,47),see(5,3,8,3),terrs(8,3,47),csums(8,3  &
59
    ,47),fopn(8,3,47),dos(8,3,47)
60
 
61
COMMON/spaces/ion,j5,k2,k3,loop1,laps,loop,m,kr,lp,n13h,ibuf,nx,l,  &
62
    npass,nfail,n,n1,n2,n13,n213,n813,n14,n16,n416,n21,nt1,nt2,last,idebug  &
63
    ,mpy,loop2,mucho,mpylim,intbuf(16)
64
 
65
COMMON/spacer/a11,a12,a13,a21,a22,a23,a31,a32,a33,ar,br,c0,cr,di,dk  &
66
    ,dm22,dm23,dm24,dm25,dm26,dm27,dm28,dn,e3,e6,expmax,flx,q,qa,r,ri  &
67
    ,s,scale,sig,stb5,t,xnc,xnei,xnm
68
 
69
COMMON/space0/time(47),csum(47),ww(47),wt(47),ticks,fr(9),terr1(47  &
70
    ),sumw(7),start,skale(47),bias(47),ws(95),total(47),flopn(47),iq(7  &
71
    ),npf,npfs1(47)
72
 
73
COMMON/spacei/wtp(3),mul(3),ispan(47,3),ipass(47,3)
74
 
75
!     ******************************************************************
76
 
77
 
78
INTEGER :: e,f,zone
79
COMMON/ispace/e(96),f(96),ix(1001),ir(1001),zone(300)
80
 
81
COMMON/space1/u(1001),v(1001),w(1001),x(1001),y(1001),z(1001),g(1001)  &
82
    ,du1(101),du2(101),du3(101),grd(1001),dex(1001),xi(1001),ex(1001)  &
83
    ,ex1(1001),dex1(1001),vx(1001),xx(1001),rx(1001),rh(2048),vsp(101)  &
84
    ,vstp(101),vxne(101),vxnd(101),ve3(101),vlr(101),vlin(101),b5(101)  &
85
    ,plan(300),d(300),sa(101),sb(101)
86
 
87
COMMON/space2/p(4,512),px(25,101),cx(25,101),vy(101,25),vh(101,7),  &
88
    vf(101,7),vg(101,7),vs(101,7),za(101,7),zp(101,7),zq(101,7),zr(101  &
89
    ,7),zm(101,7),zb(101,7),zu(101,7),zv(101,7),zz(101,7),b(64,64),c(64,64)  &
90
    ,h(64,64),u1(5,101,2),u2(5,101,2),u3(5,101,2)
91
 
92
!     ******************************************************************
93
 
94
dimension zx(1023),xz(447,3),tk(6),mtmp(1)
95
EQUIVALENCE(zx(1),z(1)),(xz(1,1),x(1))
96
double precision temp
97
logical ltmp
98
 
99
 
100
!     ******************************************************************
101
 
102
!     STANDARD PRODUCT COMPILER DIRECTIVES MAY BE USED FOR OPTIMIZATION
103
 
104
 
105
 
106
 
107
 
108
CALL trace('KERNEL  ')
109
 
110
CALL SPACE
111
 
112
mpy= 1
113
mpysav= mpylim
114
loop2= 1
115
mpylim= loop2
116
l= 1
117
loop= 1
118
lp= loop
119
it0= test(0)
120
loop2= mpysav
121
mpylim= loop2
122
do
123
 
124
!***********************************************************************
125
!***  KERNEL 1      HYDRO FRAGMENT
126
!***********************************************************************
127
 
128
  x(:n)= q+y(:n)*(r*zx(11:n+10)+t*zx(12:n+11))
129
IF(test(1) <= 0)THEN
130
  EXIT
131
END IF
132
END DO
133
 
134
do
135
!                   we must execute    DO k= 1,n  repeatedly for accurat
136
!    e timing
137
 
138
!***********************************************************************
139
!***  KERNEL 2      ICCG EXCERPT (INCOMPLETE CHOLESKY - CONJUGATE GRADIE
140
!    NT)
141
!***********************************************************************
142
 
143
 
144
ii= n
145
ipntp= 0
146
 
147
do while(ii >  1)
148
ipnt= ipntp
149
ipntp= ipntp+ii
150
ii= ishft(ii,-1)
151
i= ipntp+1
152
!dir$ vector always
153
       x(ipntp+2:ipntp+ii+1)=x(ipnt+2:ipntp:2)-v(ipnt+2:ipntp:2) &
154
     &*x(ipnt+1:ipntp-1:2)-v(ipnt+3:ipntp+1:2)*x(ipnt+3:ipntp+1:2)
155
END DO
156
IF(test(2) <= 0)THEN
157
  EXIT
158
END IF
159
END DO
160
 
161
do
162
 
163
!***********************************************************************
164
!***  KERNEL 3      INNER PRODUCT
165
!***********************************************************************
166
 
167
 
168
q= dot_product(z(:n),x(:n))
169
IF(test(3) <= 0)THEN
170
  EXIT
171
END IF
172
END DO
173
m= (1001-7)/2
174
 
175
!***********************************************************************
176
!***  KERNEL 4      BANDED LINEAR EQUATIONS
177
!***********************************************************************
178
 
179
fw= 1.000D-25
180
 
181
do
182
!dir$ vector always
183
 xz(6,:3)= y(5)*(xz(6,:3)+matmul(y(5:n:5), xz(:n/5,:3)))
184
 
185
IF(test(4) <= 0)THEN
186
  EXIT
187
END IF
188
END DO
189
 
190
do
191
 
192
!***********************************************************************
193
!***  KERNEL 5      TRI-DIAGONAL ELIMINATION, BELOW DIAGONAL (NO VECTORS
194
!    )
195
!***********************************************************************
196
 
197
 
198
tmp= x(1)
199
DO i= 2,n
200
  tmp= z(i)*(y(i)-tmp)
201
  x(i)= tmp
202
END DO
203
IF(test(5) <= 0)THEN
204
  EXIT
205
END IF
206
END DO
207
 
208
do
209
 
210
!***********************************************************************
211
!***  KERNEL 6      GENERAL LINEAR RECURRENCE EQUATIONS
212
!***********************************************************************
213
 
214
 
215
DO i= 2,n
216
  w(i)= 0.0100D0+dot_product(b(i,:i-1),w(i-1:1:-1))
217
END DO
218
IF(test(6) <= 0)THEN
219
  EXIT
220
END IF
221
END DO
222
 
223
do
224
 
225
!***********************************************************************
226
!***  KERNEL 7      EQUATION OF STATE FRAGMENT
227
!***********************************************************************
228
 
229
 
230
  x(:n)= u(:n)+r*(z(:n)+r*y(:n))+t*(u(4:n+3)+r*(u(3:n+2)+r*u(2:n+1))+t*(  &
231
      u(7:n+6)+q*(u(6:n+5)+q*u(5:n+4))))
232
IF(test(7) <= 0)THEN
233
  EXIT
234
END IF
235
END DO
236
 
237
do
238
 
239
 
240
!***********************************************************************
241
!***  KERNEL 8      A.D.I. INTEGRATION
242
!***********************************************************************
243
 
244
 
245
nl1= 1
246
nl2= 2
247
fw= 2.000D0
248
  DO ky= 2,n
249
DO kx= 2,3
250
    du1ky= u1(kx,ky+1,nl1)-u1(kx,ky-1,nl1)
251
    du2ky= u2(kx,ky+1,nl1)-u2(kx,ky-1,nl1)
252
    du3ky= u3(kx,ky+1,nl1)-u3(kx,ky-1,nl1)
253
    u1(kx,ky,nl2)= u1(kx,ky,nl1)+a11*du1ky+a12*du2ky+a13  &
254
        *du3ky+sig*(u1(kx+1,ky,nl1)-fw*u1(kx,ky,nl1)+u1(kx-1,ky,nl1))
255
    u2(kx,ky,nl2)= u2(kx,ky,nl1)+a21*du1ky+a22*du2ky+a23  &
256
        *du3ky+sig*(u2(kx+1,ky,nl1)-fw*u2(kx,ky,nl1)+u2(kx-1,ky,nl1))
257
    u3(kx,ky,nl2)= u3(kx,ky,nl1)+a31*du1ky+a32*du2ky+a33  &
258
        *du3ky+sig*(u3(kx+1,ky,nl1)-fw*u3(kx,ky,nl1)+u3(kx-1,ky,nl1))
259
  END DO
260
END DO
261
IF(test(8) <= 0)THEN
262
  EXIT
263
END IF
264
END DO
265
 
266
do
267
 
268
!***********************************************************************
269
!***  KERNEL 9      INTEGRATE PREDICTORS
270
!***********************************************************************
271
 
272
 
273
  px(1,:n)= dm28*px(13,:n)+px(3,:n)+dm27*px(12,:n)+dm26*px(11,:n)+dm25*px(10  &
274
      ,:n)+dm24*px(9,:n)+dm23*px(8,:n)+dm22*px(7,:n)+c0*(px(5,:n)+px(6,:n))
275
IF(test(9) <= 0)THEN
276
  EXIT
277
END IF
278
END DO
279
 
280
do
281
 
282
!***********************************************************************
283
!***  KERNEL 10     DIFFERENCE PREDICTORS
284
!***********************************************************************
285
 
286
!dir$ unroll(2)
287
          do k= 1,n
288
              br= cx(5,k)-px(5,k)
289
              px(5,k)= cx(5,k)
290
              cr= br-px(6,k)
291
              px(6,k)= br
292
              ar= cr-px(7,k)
293
              px(7,k)= cr
294
              br= ar-px(8,k)
295
              px(8,k)= ar
296
              cr= br-px(9,k)
297
              px(9,k)= br
298
              ar= cr-px(10,k)
299
              px(10,k)= cr
300
              br= ar-px(11,k)
301
              px(11,k)= ar
302
              cr= br-px(12,k)
303
              px(12,k)= br
304
              px(14,k)= cr-px(13,k)
305
              px(13,k)= cr
306
            enddo
307
IF(test(10) <= 0)THEN
308
  EXIT
309
END IF
310
END DO
311
 
312
do
313
 
314
!***********************************************************************
315
!***  KERNEL 11     FIRST SUM.   PARTIAL SUMS.              (NO VECTORS)
316
!***********************************************************************
317
 
318
 
319
temp= 0
320
DO k= 1,n
321
  temp= temp+y(k)
322
  x(k)= temp
323
END DO
324
IF(test(11) <= 0)THEN
325
  EXIT
326
END IF
327
END DO
328
 
329
do
330
 
331
!***********************************************************************
332
!***  KERNEL 12     FIRST DIFF.
333
!***********************************************************************
334
 
335
  x(:n)= y(2:n+1)-y(:n)
336
IF(test(12) <= 0)THEN
337
  EXIT
338
END IF
339
END DO
340
fw= 1.000D0
341
 
342
!***********************************************************************
343
!***  KERNEL 13      2-D PIC   Particle In Cell
344
!***********************************************************************
345
 
346
 
347
do
348
 
349
! rounding modes for integerizing make no difference here
350
          do k= 1,n
351
              i1= 1+iand(int(p(1,k)),63)
352
              j1= 1+iand(int(p(2,k)),63)
353
              p(3,k)= p(3,k)+b(i1,j1)
354
              p(1,k)= p(1,k)+p(3,k)
355
              i2= iand(int(p(1,k)),63)
356
              p(1,k)= p(1,k)+y(i2+32)
357
              p(4,k)= p(4,k)+c(i1,j1)
358
              p(2,k)= p(2,k)+p(4,k)
359
              j2= iand(int(p(2,k)),63)
360
              p(2,k)= p(2,k)+z(j2+32)
361
              i2= i2+e(i2+32)
362
              j2= j2+f(j2+32)
363
              h(i2,j2)= h(i2,j2)+fw
364
            enddo
365
IF(test(13) <= 0)THEN
366
  EXIT
367
END IF
368
END DO
369
fw= 1.000D0
370
 
371
!***********************************************************************
372
!***  KERNEL 14      1-D PIC   Particle In Cell
373
!***********************************************************************
374
 
375
 
376
 
377
do
378
 
379
  ix(:n)= grd(:n)
380
!dir$ ivdep
381
  vx(:n)= ex(ix(:n))-ix(:n)*dex(ix(:n))
382
  ir(:n)= vx(:n)+flx
383
  rx(:n)= vx(:n)+flx-ir(:n)
384
  ir(:n)= iand(ir(:n),2047)+1
385
  xx(:n)= rx(:n)+ir(:n)
386
DO k= 1,n
387
      rh(ir(k))= rh(ir(k))+fw-rx(k)
388
      rh(ir(k)+1)= rh(ir(k)+1)+rx(k)
389
END DO
390
IF(test(14) <= 0)THEN
391
  EXIT
392
END IF
393
END DO
394
 
395
do
396
 
397
!***********************************************************************
398
!***  KERNEL 15     CASUAL FORTRAN.  DEVELOPMENT VERSION.
399
!***********************************************************************
400
 
401
 
402
!       CASUAL ORDERING OF SCALAR OPERATIONS IS TYPICAL PRACTICE.
403
!       THIS EXAMPLE DEMONSTRATES THE NON-TRIVIAL TRANSFORMATION
404
!       REQUIRED TO MAP INTO AN EFFICIENT MACHINE IMPLEMENTATION.
405
 
406
 
407
ng= 7
408
nz= n
409
ar= 0.05300D0
410
br= 0.07300D0
411
!$omp parallel do private(t,j,k,r,s,i,ltmp) if(nz>98)
412
do j= 2,ng-1
413
  do k= 2,nz
414
    i= merge(k-1,k,vf(k,j) <  vf((k-1),j))
415
    t= merge(br,ar,vh(k,(j+1)) <= vh(k,j))
416
    r= MAX(vh(i,j),vh(i,j+1))
417
    s= vf(i,j)
418
    vy(k,j)= t/s*SQRT(vg(k,j)**2+r*r)
419
    if(k < nz)then
420
        ltmp=vf(k,j) >= vf(k,(j-1))
421
        i= merge(j,j-1,ltmp)
422
        t= merge(ar,br,ltmp)
423
        r= MAX(vg(k,i),vg(k+1,i))
424
        s= vf(k,i)
425
        vs(k,j)= t/s*SQRT(vh(k,j)**2+r*r)
426
    endif
427
  END do
428
  vs(nz,j)= 0.0D0
429
END do
430
  vy(2:nz,ng)= 0.0D0
431
IF(test(15) <= 0)THEN
432
  EXIT
433
END IF
434
END DO
435
ii= n/3
436
 
437
!***********************************************************************
438
!***  KERNEL 16     MONTE CARLO SEARCH LOOP
439
!***********************************************************************
440
 
441
lb= ii+ii
442
k2= 0
443
k3= 0
444
 
445
do
446
DO m= 1,zone(1)
447
  j2= (n+n)*(m-1)+1
448
  DO k= 1,n
449
    k2= k2+1
450
    j4= j2+k+k
451
    j5= zone(j4)
452
    IF(j5 >= n)THEN
453
      IF(j5 == n)THEN
454
        EXIT
455
      END IF
456
      k3= k3+1
457
      IF(d(j5) <  d(j5-1)*(t-d(j5-2))**2+(s-d(j5-3))**2+ (r-d(j5-4))**2)THEN
458
        go to 200
459
      END IF
460
      IF(d(j5) == d(j5-1)*(t-d(j5-2))**2+(s-d(j5-3))**2+ (r-d(j5-4))**2)THEN
461
        EXIT
462
      END IF
463
    ELSE
464
      IF(j5-n+lb <  0)THEN
465
        IF(plan(j5) <  t)THEN
466
          go to 200
467
        END IF
468
        IF(plan(j5) == t)THEN
469
          EXIT
470
        END IF
471
      ELSE
472
        IF(j5-n+ii <  0)THEN
473
          IF(plan(j5) <  s)THEN
474
            go to 200
475
          END IF
476
          IF(plan(j5) == s)THEN
477
            EXIT
478
          END IF
479
        ELSE
480
          IF(plan(j5) <  r)THEN
481
            go to 200
482
          END IF
483
          IF(plan(j5) == r)THEN
484
            EXIT
485
          END IF
486
        END IF
487
      END IF
488
    END IF
489
    IF(zone(j4-1) <= 0)THEN
490
      go to 200
491
    END IF
492
  END DO
493
  EXIT
494
  200             IF(zone(j4-1) == 0)THEN
495
    EXIT
496
  END IF
497
END DO
498
IF(test(16) <= 0)THEN
499
  EXIT
500
END IF
501
END DO
502
dw= 5.0000D0/3.0000D0
503
 
504
!***********************************************************************
505
!***  KERNEL 17     IMPLICIT, CONDITIONAL COMPUTATION       (NO VECTORS)
506
!***********************************************************************
507
 
508
!         RECURSIVE-DOUBLING VECTOR TECHNIQUES CAN NOT BE USED
509
!         BECAUSE CONDITIONAL OPERATIONS APPLY TO EACH ELEMENT.
510
 
511
fw= 1.0000D0/3.0000D0
512
tw= 1.0300D0/3.0700D0
513
 
514
do
515
scale= dw
516
rtmp= fw
517
e6= tw
518
DO k= n,2,-1
519
  e3= rtmp*vlr(k)+vlin(k)
520
  xnei= vxne(k)
521
  vxnd(k)= e6
522
  xnc= scale*e3
523
!                                      SELECT MODEL
524
  IF(max(rtmp,xnei) <= xnc)THEN
525
!                                      LINEAR MODEL
526
    ve3(k)= e3
527
    rtmp= e3+e3-rtmp
528
    vxne(k)= e3+e3-xnei
529
  ELSE
530
    rtmp= rtmp*vsp(k)+vstp(k)
531
!                                      STEP MODEL
532
    vxne(k)= rtmp
533
    ve3(k)= rtmp
534
  END IF
535
    e6= rtmp
536
END DO
537
xnm= rtmp
538
IF(test(17) <= 0)THEN
539
  EXIT
540
END IF
541
END DO
542
 
543
do
544
 
545
!***********************************************************************
546
!***  KERNEL 18     2-D EXPLICIT HYDRODYNAMICS FRAGMENT
547
!***********************************************************************
548
 
549
 
550
t= 0.003700D0
551
s= 0.004100D0
552
kn= 6
553
jn= n
554
  zb(2:jn,2:kn)=(zr(2:jn,2:kn)+zr(2:jn,:kn-1))/(zm(2:jn,2:kn)+zm(:jn-1,2:kn)) &
555
        *(zp(:jn-1,2:kn)-zp(2:jn,2:kn)+(zq(:jn-1,2:kn)-zq(2:jn,2:kn)))
556
  za(2:jn,2:kn)=(zr(2:jn,2:kn)+zr(:jn-1,2:kn))/(zm(:jn-1,2:kn)+zm(:jn-1,3:kn+1))  &
557
        *(zp(:jn-1,3:kn+1)-zp(:jn-1,2:kn)+(zq(:jn-1,3:kn+1)-zq(:jn-1,2:kn)))
558
  zu(2:jn,2:kn)= zu(2:jn,2:kn)+ &
559
        s*(za(2:jn,2:kn)*(zz(2:jn,2:kn)-zz(3:jn+1,2:kn)) &
560
        -za(:jn-1,2:kn)*(zz(2:jn,2:kn)-zz(:jn-1,2:kn)) &
561
        -zb(2:jn,2:kn)*(zz(2:jn,2:kn)-zz(2:jn,:kn-1))+ &
562
        zb(2:jn,3:kn+1)*(zz(2:jn, 2:kn)-zz(2:jn,3:kn+1)))
563
  zv(2:jn,2:kn)= zv(2:jn,2:kn)+ &
564
        s*(za(2:jn,2:kn)*(zr(2:jn,2:kn)-zr(3:jn+1,2:kn)) &
565
        -za(:jn-1,2:kn)*(zr(2:jn,2:kn)-zr(:jn-1,2:kn)) &
566
        -zb(2:jn,2:kn)*(zr(2:jn,2:kn)-zr(2:jn,:kn-1))+ &
567
        zb(2:jn,3:kn+1)*(zr(2:jn, 2:kn)-zr(2:jn,3:kn+1)))
568
  zr(2:jn,2:kn)= zr(2:jn,2:kn)+t*zu(2:jn,2:kn)
569
  zz(2:jn,2:kn)= zz(2:jn,2:kn)+t*zv(2:jn,2:kn)
570
IF(test(18) <= 0)THEN
571
  EXIT
572
END IF
573
END DO
574
 
575
do
576
 
577
!***********************************************************************
578
!***  KERNEL 19      GENERAL LINEAR RECURRENCE EQUATIONS    (NO VECTORS)
579
!***********************************************************************
580
 
581
kb5i= 0
582
 
583
DO k= 1,n
584
  b5(k+kb5i)= sa(k)+stb5*sb(k)
585
  stb5= b5(k+kb5i)-stb5
586
END DO
587
DO k= n,1,-1
588
  b5(k+kb5i)= sa(k)+stb5*sb(k)
589
  stb5= b5(k+kb5i)-stb5
590
END DO
591
IF(test(19) <= 0)THEN
592
  EXIT
593
END IF
594
END DO
595
dw= 0.200D0
596
 
597
!***********************************************************************
598
!***  KERNEL 20     DISCRETE ORDINATES TRANSPORT: RECURRENCE (NO VECTORS
599
!***********************************************************************
600
 
601
 
602
do
603
 
604
rtmp= xx(1)
605
DO k= 1,n
606
  di= y(k)*(rtmp+dk)-g(k)
607
  dn=merge( max(s,min(z(k)*(rtmp+dk)/di,t)),dw,di /= 0.0)
608
  x(k)= ((w(k)+v(k)*dn)*rtmp+u(k))/(vx(k)+v(k)*dn)
609
  rtmp= ((w(k)-vx(k))*rtmp+u(k))*DN/(vx(k)+v(k)*dn)+ rtmp
610
 xx(k+1)= rtmp
611
END DO
612
IF(test(20) <= 0)THEN
613
  EXIT
614
END IF
615
END DO
616
 
617
do
618
 
619
!***********************************************************************
620
!***  KERNEL 21     MATRIX*MATRIX PRODUCT
621
!***********************************************************************
622
 
623
    px(:25,:n)= px(:25,:n)+matmul(vy(:25,:25),cx(:25,:n))
624
IF(test(21) <= 0)THEN
625
  EXIT
626
END IF
627
END DO
628
expmax= 20.0000D0
629
 
630
 
631
!***********************************************************************
632
!***  KERNEL 22     PLANCKIAN DISTRIBUTION
633
!***********************************************************************
634
 
635
!      EXPMAX= 234.500d0
636
fw= 1.00000D0
637
u(n)= 0.99000D0*expmax*v(n)
638
 
639
do
640
 
641
  y(:n)= u(:n)/v(:n)
642
  w(:n)= x(:n)/(EXP(y(:n))-fw)
643
IF(test(22) <= 0)THEN
644
  EXIT
645
END IF
646
END DO
647
fw= 0.17500D0
648
 
649
!***********************************************************************
650
!***  KERNEL 23     2-D IMPLICIT HYDRODYNAMICS FRAGMENT
651
!***********************************************************************
652
 
653
 
654
do
655
 
656
      DO k= 2,n
657
         do j=2,6
658
             za(k,j)= za(k,j)+fw*(za(k,j+1)*zr(k,j)-za(k,j)+            &
659
     &          zv(k,j)*za(k-1,j)+(zz(k,j)+za(k+1,j)*                   &
660
     &          zu(k,j)+za(k,j-1)*zb(k,j)))
661
      END DO
662
    END DO
663
IF(test(23) <= 0)THEN
664
  EXIT
665
END IF
666
END DO
667
x(n/2)= -1.000D+10
668
 
669
!***********************************************************************
670
!***  KERNEL 24     FIND LOCATION OF FIRST MINIMUM IN ARRAY
671
!***********************************************************************
672
 
673
!      X( n/2)= -1.000d+50
674
 
675
do
676
 m= minloc(x(:n),DIM=1)
677
 
678
IF(test(24) == 0)THEN
679
  EXIT
680
END IF
681
END DO
682
sum= 0.00D0
683
som= 0.00D0
684
DO k= 1,mk
685
  sum= sum+time(k)
686
  times(jr,il,k)= time(k)
687
  terrs(jr,il,k)= terr1(k)
688
  npfs(jr,il,k)= npfs1(k)
689
  csums(jr,il,k)= csum(k)
690
  dos(jr,il,k)= total(k)
691
  fopn(jr,il,k)= flopn(k)
692
  som= som+flopn(k)*total(k)
693
END DO
694
tk(1)= tk(1)+sum
695
tk(2)= tk(2)+som
696
!                        Dumpout Checksums:  file "chksum"
697
!     WRITE ( 7,706) jr, il
698
! 706 FORMAT(1X,2I3)
699
!     WRITE ( 7,707) ( CSUM(k), k= 1,mk)
700
! 707 FORMAT(5X,'&',1PE23.16,',',1PE23.16,',',1PE23.16,',')
701
 
702
CALL track('KERNEL  ')
703
RETURN
704
END SUBROUTINE kernel
705
 
706
! { dg-final { scan-tree-dump-times "vectorized 19 loops" 1 "vect" } }
707
! { dg-final { cleanup-tree-dump "vect" } }
708
! { dg-final { cleanup-modules "lfk_prec" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.