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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
! { dg-do run }
2
program nested1
3
  use omp_lib
4
  integer :: e1, e2, e3, e
5
  integer :: tn1, tn2, tn3
6
  e1 = 0
7
  e2 = 0
8
  e3 = 0
9
  call omp_set_nested (.true.)
10
  call omp_set_dynamic (.false.)
11
  if (omp_in_parallel ()) call abort
12
  if (omp_get_num_threads ().ne.1) call abort
13
  if (omp_get_level ().ne.0) call abort
14
  if (omp_get_ancestor_thread_num (0).ne.0) call abort
15
  if (omp_get_ancestor_thread_num (-1).ne.-1) call abort
16
  if (omp_get_ancestor_thread_num (1).ne.-1) call abort
17
  if (omp_get_team_size (0).ne.1) call abort
18
  if (omp_get_team_size (-1).ne.-1) call abort
19
  if (omp_get_team_size (1).ne.-1) call abort
20
  if (omp_get_active_level ().ne.0) call abort
21
!$omp parallel num_threads (4) private (e, tn1)
22
  e = 0
23
  tn1 = omp_get_thread_num ()
24
  if (.not.omp_in_parallel ()) e = e + 1
25
  if (omp_get_num_threads ().ne.4) e = e + 1
26
  if (tn1.lt.0.or.tn1.ge.4) e = e + 1
27
  if (omp_get_level ().ne.1) e = e + 1
28
  if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
29
  if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
30
  if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
31
  if (omp_get_ancestor_thread_num (2).ne.-1) e = e + 1
32
  if (omp_get_team_size (0).ne.1) e = e + 1
33
  if (omp_get_team_size (1).ne.4) e = e + 1
34
  if (omp_get_team_size (-1).ne.-1) e = e + 1
35
  if (omp_get_team_size (2).ne.-1) e = e + 1
36
  if (omp_get_active_level ().ne.1) e = e + 1
37
  !$omp atomic
38
    e1 = e1 + e
39
!$omp parallel num_threads (5) if (.false.) firstprivate (tn1) &
40
!$omp& private (e, tn2)
41
  e = 0
42
  tn2 = omp_get_thread_num ()
43
  if (.not.omp_in_parallel ()) e = e + 1
44
  if (omp_get_num_threads ().ne.1) e = e + 1
45
  if (tn2.ne.0) e = e + 1
46
  if (omp_get_level ().ne.2) e = e + 1
47
  if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
48
  if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
49
  if (omp_get_ancestor_thread_num (2).ne.tn2) e = e + 1
50
  if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
51
  if (omp_get_ancestor_thread_num (3).ne.-1) e = e + 1
52
  if (omp_get_team_size (0).ne.1) e = e + 1
53
  if (omp_get_team_size (1).ne.4) e = e + 1
54
  if (omp_get_team_size (2).ne.1) e = e + 1
55
  if (omp_get_team_size (-1).ne.-1) e = e + 1
56
  if (omp_get_team_size (3).ne.-1) e = e + 1
57
  if (omp_get_active_level ().ne.1) e = e + 1
58
  !$omp atomic
59
    e2 = e2 + e
60
!$omp parallel num_threads (2) firstprivate (tn1, tn2) &
61
!$omp& private (e, tn3)
62
  e = 0
63
  tn3 = omp_get_thread_num ()
64
  if (.not.omp_in_parallel ()) e = e + 1
65
  if (omp_get_num_threads ().ne.2) e = e + 1
66
  if (tn3.lt.0.or.tn3.ge.2) e = e + 1
67
  if (omp_get_level ().ne.3) e = e + 1
68
  if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
69
  if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
70
  if (omp_get_ancestor_thread_num (2).ne.tn2) e = e + 1
71
  if (omp_get_ancestor_thread_num (3).ne.tn3) e = e + 1
72
  if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
73
  if (omp_get_ancestor_thread_num (4).ne.-1) e = e + 1
74
  if (omp_get_team_size (0).ne.1) e = e + 1
75
  if (omp_get_team_size (1).ne.4) e = e + 1
76
  if (omp_get_team_size (2).ne.1) e = e + 1
77
  if (omp_get_team_size (3).ne.2) e = e + 1
78
  if (omp_get_team_size (-1).ne.-1) e = e + 1
79
  if (omp_get_team_size (4).ne.-1) e = e + 1
80
  if (omp_get_active_level ().ne.2) e = e + 1
81
  !$omp atomic
82
    e3 = e3 + e
83
!$omp end parallel
84
!$omp end parallel
85
!$omp end parallel
86
  if (e1.ne.0.or.e2.ne.0.or.e3.ne.0) call abort
87
end program nested1

powered by: WebSVN 2.1.0

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