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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.fortran/] [pr27395-2.f90] - Blame information for rev 307

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

Line No. Rev Author Line
1 273 jeremybenn
! PR fortran/27395
2
! { dg-do run }
3
 
4
program pr27395_2
5
  implicit none
6
  integer, parameter :: n=10,m=1001
7
  integer :: i
8
  call foo(n,m)
9
end program pr27395_2
10
 
11
subroutine foo(n,m)
12
  use omp_lib, only : omp_get_thread_num
13
  implicit none
14
  integer, intent(in) :: n,m
15
  integer :: i,j
16
  integer, dimension(n) :: sumarray
17
  sumarray(:)=0
18
!$OMP PARALLEL DEFAULT(shared) NUM_THREADS(4)
19
!$OMP DO PRIVATE(j,i), REDUCTION(+:sumarray)
20
  do j=1,m
21
    do i=1,n
22
      sumarray(i)=sumarray(i)+i
23
    end do
24
  end do
25
!$OMP END DO
26
!$OMP END PARALLEL
27
  do i=1,n
28
    if (sumarray(i).ne.m*i) call abort
29
  end do
30
end subroutine foo

powered by: WebSVN 2.1.0

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