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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [pr27395-1.f90] - Blame information for rev 791

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

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

powered by: WebSVN 2.1.0

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