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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [appendix-a/] [a.4.1.f90] - Blame information for rev 735

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
! { dg-do run }
2
      SUBROUTINE SUBDOMAIN(X, ISTART, IPOINTS)
3
          INTEGER ISTART, IPOINTS
4
          REAL X(*)
5
          INTEGER I
6
          DO 100 I=1,IPOINTS
7
             X(ISTART+I) = 123.456
8
 100      CONTINUE
9
      END SUBROUTINE SUBDOMAIN
10
      SUBROUTINE SUB(X, NPOINTS)
11
          INCLUDE "omp_lib.h"      ! or USE OMP_LIB
12
          REAL X(*)
13
          INTEGER NPOINTS
14
          INTEGER IAM, NT, IPOINTS, ISTART
15
!$OMP PARALLEL DEFAULT(PRIVATE) SHARED(X,NPOINTS)
16
          IAM = OMP_GET_THREAD_NUM()
17
          NT = OMP_GET_NUM_THREADS()
18
          IPOINTS = NPOINTS/NT
19
          ISTART = IAM * IPOINTS
20
          IF (IAM .EQ. NT-1) THEN
21
              IPOINTS = NPOINTS - ISTART
22
          ENDIF
23
          CALL SUBDOMAIN(X,ISTART,IPOINTS)
24
!$OMP END PARALLEL
25
      END SUBROUTINE SUB
26
      PROGRAM A4
27
          REAL ARRAY(10000)
28
          CALL SUB(ARRAY, 10000)
29
      END PROGRAM A4

powered by: WebSVN 2.1.0

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