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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [gomp/] [appendix-a/] [a.12.1.f90] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do compile }
      SUBROUTINE A12( X, XOLD, N, TOL )
      REAL X(*), XOLD(*), TOL
      INTEGER N
      INTEGER C, I, TOOBIG
      REAL ERROR, Y, AVERAGE
      EXTERNAL AVERAGE
      C=0
      TOOBIG = 1
!$OMP PARALLEL
        DO WHILE( TOOBIG > 0 )
!$OMP DO PRIVATE(I)
            DO I = 2, N-1
               XOLD(I) = X(I)
            ENDDO
!$OMP SINGLE
            TOOBIG = 0
!$OMP END SINGLE
!$OMP DO PRIVATE(I,Y,ERROR), REDUCTION(+:TOOBIG)
            DO I = 2, N-1
               Y = X(I)
               X(I) = AVERAGE( XOLD(I-1), X(I), XOLD(I+1) )
               ERROR = Y-X(I)
               IF( ERROR > TOL .OR. ERROR < -TOL ) TOOBIG = TOOBIG+1
            ENDDO
!$OMP MASTER
            C=C+1
            PRINT *, "Iteration ", C, " TOOBIG=", TOOBIG
!$OMP END MASTER
        ENDDO
!$OMP END PARALLEL
      END SUBROUTINE A12

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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